fix: add email confirmation screen and auth callback redirect (#208)#218
Merged
Conversation
Co-authored-by: Ona <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
✅ UI verification passed — design spec compliance confirmed. Files reviewed:
Static analysis (all pass):
Visual verification (6 screenshots — desktop dark + mobile for 3 routes):
|
Collaborator
Author
|
✅ Post-merge verification passed. E2E suite: 57/57 tests passed (auth, editor, page CRUD, sidebar drag, search, workspace switcher, members, import/export). Ad-hoc smoke tests:
Skipped:
|
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.
Closes #208
What
The sign-up flow had no feedback after a user registered when email confirmation was enabled. Users saw no "check your inbox" screen and had no idea what to do next. Additionally, clicking the confirmation link in the email redirected to the landing page instead of the sign-in screen.
How
Three changes:
Sign-up page — after
signUp(), detect when email confirmation is required (Supabase returns emptyidentitiesarray) and show a "Check your inbox" confirmation screen with the user's email address, instead of attempting to redirect to a workspace. Also passesemailRedirectTopointing to/auth/callbackso the confirmation link lands in the right place.Auth callback route (
src/app/auth/callback/route.ts) — new server-side route that exchanges the Supabase auth code for a session, signs the user out (so they get a fresh sign-in), and redirects to/sign-in?confirmed=true. Added/auth/callbackto the proxy's public routes list.Sign-in page — reads the
confirmed=truequery param and displays a success message: "Email confirmed — you can now sign in." Wrapped in aSuspenseboundary foruseSearchParams()compatibility.Testing
sign-up/page.test.tsxto verify the confirmation screen appears whenidentitiesis empty, and thatemailRedirectTois passed tosignUp(). Updatedsign-in/page.test.tsxto verify the confirmed banner appears/hides based on query param. Addedauth/callback/route.test.tscovering code exchange success, failure, and missing code scenarios.e2e/auth.spec.ts— confirmation message visibility with/without query param, and auth callback redirect behavior.