Code RoomGenerate authentication and session system
HardPrep Room Coding #4042

Generate authentication and session system

Vibe & agenticSecuritySenior–Staff~18 min

Your startup needs an authentication and session system (Node.js/TypeScript): signup, login, password reset, session management, MFA. Under deadline pressure, the team wants an AI agent to generate the whole auth stack from scratch in a day. Make the call on whether to delegate this, what failure modes make AI-generated auth risky, and what you'd do instead.

Implement
decide_login_outcome(account_row: str, password_ok: bool, second_factor: str, now_epoch_s: int) → list[str]
Examples
in["true|0|true|5",true,"totp_ok",1000]out["issue_session","ok"]
in["false|0|false|0",false,"none",1000]out["reject_unknown_user","invalid_credentials"]
in["true|0|true|3",true,"recovery_ok",1000]out["issue_session_step_up_required","ok"]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.