Repository navigation
fix(auth): keep the return path when Google refuses an unverified email - #15
Merged
Merged
Conversation
The signIn callback can't see the request, so /login?error=GoogleEmailUnverified dropped the destination kept in the callback-url cookie. The email-code fallback then landed on /dashboard, and a mobile sign-in never handed off its session. The NextAuth route now adds the cookie's safe return path as next on that redirect, the same way SSO errors keep theirs. Also drops a test comment that only restated the code.
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.
Brings the review fix from CapSoftware#3964 into
smg.When Google refuses a sign-in because the email isn't verified,
/login?error=GoogleEmailUnverifiednow carries the safe return path from thenext-auth.callback-urlcookie asnext, so the email-code fallback (and a mobile handoff) finishes the original flow instead of landing on/dashboard. Off-origin paths are dropped.Tests: two new cases in
sso-auth-route.test.ts; auth suites pass (140).