UNDERSTAND
Bring these concepts with you
BUILD
Your implementation
- Implement login with the supplied matches helper and dummy password record for missing users. Return the same credential error for missing accounts and wrong passwords.
- Generate a fresh random token for each successful login. Store only its hash, user ID, and expiry in sessions.
- Return the raw token to the HTTP adapter. Do not return it in the JSON response or write it to logs.
function login(id, password) {
// Verify, generate a token, store its hash and expiry, return token.
}Need a hint?
- randomBytes(32).toString("base64url") provides an opaque token; tokenHash derives its lookup key.
- The injected now function makes expiry deterministic in tests.
Saved on this device · 0 / 6000 · Do not include passwords or private data.
VERIFY
Acceptance checks
From the folder containing your downloaded files, run:
node checks.mjs ./starter.mjs 2This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.
Record your attempt to enable the checklist and reference comparison.
Compare with the reference
Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.
EXPLAIN
Your interviewer asks
Why store the hash of a random session token? What happens if the session store leaks?
Say your answer aloud, then record the trade-offs and evidence in your notes above.
LOCAL VOICE REHEARSAL
Rehearse your step walkthrough aloud
00:00/ 02:00