Add Google OAuth, magic link, and password reset#50
Open
vahid-ahmadi wants to merge 1 commit intomainfrom
Open
Add Google OAuth, magic link, and password reset#50vahid-ahmadi wants to merge 1 commit intomainfrom
vahid-ahmadi wants to merge 1 commit intomainfrom
Conversation
Code-side completes the auth surface:
- AuthContext gains signInWithGoogle, signInWithMagicLink,
resetPassword, and updatePassword. All are no-ops with a clear error
when Supabase isn't configured (matches existing pattern).
- ChatPage's auth modal is restructured: "Continue with Google" button
at top, divider, then email/password (signin/signup) or single email
(magic-link/reset). "Forgot password?" sits beneath the password
field on signin and switches the modal to reset mode. After magic
link / reset / signup confirmation, a "Check your email" notice
replaces the form until the user dismisses it.
- New page at /reset-password/ — Supabase deep-link target. The SDK
picks up the recovery token from the URL hash and creates a session;
the page shows a "set new password" form, calls updateUser, and
bounces back to /. Invalid / expired links show a helpful error.
The existing email+password flow is untouched: existing users continue
to work without migration.
DASHBOARD CONFIG REQUIRED (out-of-band, not in this PR):
- Enable the Google provider in Supabase project settings; paste OAuth
client id + secret from a Google Cloud Console OAuth client.
- Add prod + PR-beta + localhost origins under "Redirect URLs":
https://policyengine-uk-chat.vercel.app
https://policyengine-uk-chat.vercel.app/reset-password
plus the equivalent preview-domain entries
plus http://localhost:3006(/reset-password) for dev
- Confirm the email templates point at the right domains (Supabase
defaults to the project URL; we want app domain).
Closes #45
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Beta preview is ready.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the auth surface — the existing email+password flow stays as a fallback; new users (and forgetful old ones) get three additional paths.
Closes #45.
What's in this PR (code only)
This is the gating piece I can't do for you — needs Supabase + Google Cloud Console access:
Once those are done, the deployed app picks them up — no further code change needed.
Test plan