Add Google sign-in alongside emailed codes #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "google-sign-in"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an optional "Continue with Google" button to
/login, next to the existing one-time-code flow.How it works
POST /api/auth/google/startchecks the public origin, stores the flow state in a signed, HTTP-only, 10-minute cookie scoped to/api/auth/google, and redirects to Google.GET /api/auth/google/callbackchecks the state, exchanges the code, validates the ID token claims (issuer, audience, expiry, nonce, verified email), then creates the usual session throughrecordLoginandsetSessionCookie.openid emailscopes are requested. No Google tokens or profile data are stored.nextreturn path carry through the Google flow.Configuration
The button stays hidden, and both routes refuse, unless these are set in Dokploy:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETAuthorised redirect URI to register in Google Cloud Console:
https://gurusetu.com/api/auth/google/callbackMerging without those variables changes nothing visible on the live site.
Also changed
README.mdand.env.exampledocument the setup.Testing
🤖 Generated with Claude Code
https://claude.ai/code/session_012yR4PN5YbyxvArKFKSdkgj