Ferreteria/v0.5/login/submit: Difference between revisions
< Ferreteria | v0.5 | login
Jump to navigation
Jump to search
(Created page with "==Process== This happens when the user submits a username and password. * Search for username in the Accounts table. * If found: ** Check password match ** If matched: *** (lo...") |
m (2 revisions imported: moving this project here) |
||
(One intermediate revision by one other user not shown) | |||
Line 18: | Line 18: | ||
** '''Event log''': failed login, unknown user | ** '''Event log''': failed login, unknown user | ||
==Code== | ==Code== | ||
<code>{{ | <code>{{l/ver/method|users/csLogin/TryLogin|csLogin::TryLogin}}($sUser,$sPass)}}</code> : handle the logic for user login attempt; do necessary bookkeeping for result | ||
Latest revision as of 16:44, 22 May 2022
Process
This happens when the user submits a username and password.
- Search for username in the Accounts table.
- If found:
- Check password match
- If matched:
- (login conditions satisfied for now -- though eventually we'll want to check account status in case it is suspended (not yet supported))
- Find/create Session record for user's browser
- Session bookkeeping: (a) save Account ID, (b) update WhenUsed
- Account bookkeeping: update WhenLogin
- Login object bookkeeping: (a) save Session and Account; (b) note success
- Event log: successful login
- Else (if not matched)
- Login object bookkeeping: (a) save Account; (b) note failure
- Event log: failed login, bad pw
- Else (if not found)
- Login object bookkeeping: note login-failed
- Event log: failed login, unknown user
Code
Template:L/ver/method($sUser,$sPass)}}
: handle the logic for user login attempt; do necessary bookkeeping for result