Skip to content

redesign/oauth login - #40

Merged
Dunkrick merged 3 commits into
mainfrom
redesign/oauth-login
Oct 28, 2026
Merged

Dunkrick merged 3 commits into
mainfrom
redesign/oauth-login

Conversation

@Dunkrick

Copy link
Copy Markdown
Owner

Summary

Simplifies user authentication by adding Google and GitHub OAuth 2.0 login alongside traditional email/password, with identity reconciliation that prevents duplicate accounts for the same user.

Decisions and Rationale

  1. Decoupled User Identity (OAuthAccount model + nullable User.passwordHash):
    • Reason: Enables a single human user to have multiple authentication methods without generating duplicate accounts or relying on dummy passwords.
  2. Reconciliation Hierarchy (Provider User ID -> Verified Email Match -> Creation):
    • Reason: Matches existing provider IDs first. If a user previously signed up via email/password, matches against provider-verified email and links the account. If no verified email is present, access is blocked to prevent account takeover.
  3. Native Node 22 fetch for Provider Token Exchange:
    • Reason: Adheres to AGENTS.md by introducing zero new third-party dependencies.
  4. Dynamic Origin Detection via OAuth state Nonce:
    • Reason: Resolves requesting frontend origin (e.g. localhost:5173 vs production Vercel) and redirects back to the appropriate callback handler dynamically.
  5. Nook Design System Adherence:
    • Reason: All social buttons use --radius-0 square geometry, tokenized ink borders (--border-subtle), monochrome icons (currentColor), and sentence-case labels.
  6. Guard on Traditional Password Login:
    • Reason: Clarifies to users who signed up via social login that they should use their social provider or reset their password.

Verification

  • Frontend: npm run lint (0 errors), npm run build (success), npm test -- --run (39/39 passing)
  • Backend: npm run typecheck (0 errors), npm test (71/71 passing)

Signed-off-by: Dunkrick <rithwickgurram05@gmail.com>
…econciliation

Signed-off-by: Dunkrick <rithwickgurram05@gmail.com>
Signed-off-by: Dunkrick <rithwickgurram05@gmail.com>
@vercel

vercel Bot commented Oct 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nook Ready Ready Preview Oct 28, 2026 6:25am UTC

@Dunkrick
Dunkrick merged commit 4ebe527 into main Oct 28, 2026
3 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — bb8df18f Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant