GitHub OAuth login
You're building 'Sign in with GitHub' (OAuth 2.0 authorization-code flow) from scratch in a Python/Flask app with an AI agent — no Auth0/passport, hand-rolled against GitHub's endpoints. Describe the build plan: the flow's steps, the security parameters you make non-negotiable, session handling, and acceptance criteria. What does a careless 'implement GitHub login' prompt leave dangerously wrong?
Implement
validate_oauth_callback(callback_lines: list[str], expected_state: str, allowed_redirect_uris: list[str]) → list[str]Examples
in
[["st_abc|code_1|https://app.example.com/callback","st_abc|code_1|https://app.example.com/callback"],"st_abc",["https://app.example.com/callback"]]out["accept_new_session","reject_code_replay"]in
[["st_wrong|code_2|https://app.example.com/callback","st_abc|code_3|https://evil.example.com/callback","st_abc||https://app.example.com/callback"],"st_abc",["https://app.example.com/callback"]]out["reject_state_mismatch","reject_redirect_uri","reject_missing_code"]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 28 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.
Run or narrate your approach, then ask the coach.