Use-case 0002 — Log in
Initiating actor: Visitor
Other actors: —
A registered user authenticates so the system can treat subsequent actions as a Trader.
Scenario
- Visitor chooses "Login" from the anonymous menu.
- System prompts for username and password.
- Visitor enters values.
- System looks up the user:
SELECT id, password_hash FROM project.users WHERE username = $1;
- If no row is returned, system responds "Invalid credentials." and scenario ends.
- If a row is returned, system compares the stored hash against sha256 of the entered password. On mismatch it responds "Invalid credentials." and ends.
- On match, system records the returned
idand username in the session and displays the authenticated menu.
Alternate flow 4a — authenticated lookup with live balance
The system may combine identity lookup with live balance in a single query, for use cases that need both:
SELECT id, available_balance, invested_balance FROM project.users WHERE username = $1 AND password_hash = encode(digest($2, 'sha256'), 'hex');
Last modified
3 days ago
Last modified on 09/24/26 13:49:46
Note:
See TracWiki
for help on using the wiki.
