• feat(auth): implement Google OAuth callback with user auto-creation

    MythEclipse released this 2026-06-15 14:35:40 +00:00 | 58 commits to main since this release

    API (apps/api/src/routes/auth.ts):

    • Exchange authorization code for tokens via Google's token endpoint
    • Decode id_token payload (JWT) to extract sub, email, name
    • Find user by googleId → fall back to email match (link accounts)
    • Auto-create user if neither found (role: 'user', no password)
    • Create session + set cookie, redirect to /login?token=

    Web (apps/web/src/pages/login-page.tsx):

    • Consume ?token= query param from OAuth redirect
    • Store token in localStorage for future API calls
    • Fetch /auth/me to hydrate Zustand store, then navigate to dashboard
    • Show OAuth errors from ?error= query param

    Co-Authored-By: Claude noreply@anthropic.com

    Downloads