Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes an OAuth redirect bug when a signed-in user chooses “use a different account” (and when navigating from login → signup), ensuring OAuth authorize parameters are preserved correctly across redirects.
Changes:
- URL-encode the nested OAuth authorize URL when redirecting to
/loginfrom account selection (“use different account”). - Preserve the
redirectquery param when navigating between/loginand/register. - Add E2E coverage to prevent regressions for both “switch account” and “login → sign up → register” flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| e2e/oauth/account-select.spec.ts | Adds E2E tests asserting OAuth params survive “use different account” and login→signup flows. |
| components/auth/register-form.tsx | Preserves redirect when linking to login and (in E2E mode) redirects to redirect after successful registration. |
| components/auth/login-form.tsx | Preserves redirect when linking to register from the login page. |
| actions/oauth/account-select.ts | Fixes nested redirect construction by encoding the inner authorize URL as a single redirect param. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+16
| authorizeParams.set("fresh_login", "true"); | ||
| const loginParams = new URLSearchParams({ | ||
| redirect: `/api/oauth/authorize?${authorizeParams.toString()}`, | ||
| }); | ||
| redirect(`/login?${loginParams.toString()}`); |
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.
No description provided.