fix(register): preserve ?redirect= through cross-origin sign-in flows#48
Merged
Conversation
…#47) When a new user clicked through from a consumer app (e.g. hera-streamer-…/) to auth.criticalbit.gg/login?redirect=…, clicking "Don't have an account? Sign up" dropped the redirect param. After registration they landed on /profile instead of bouncing back to the consumer app. Three small changes, mirroring how /login already handles redirect: - login-page.tsx Sign-up Link passes `search={redirect ? { redirect } : {}}` so the query param survives the hop. - routes/register.tsx adds `validateSearch` for the redirect param. - register-page.tsx reads the param after auto-login and routes to it with the same cross-origin (window.location.href) vs in-app (navigate) split that login-page uses. Closes #47.
✅ Deploy Preview for criticalbit-auth-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 #47. Three small changes that mirror how `/login` already handles `?redirect=`.
Symptom
A new user clicking through from a consumer app (e.g. `hera-streamer-invitational-2026.criticalbit.gg`) lands at `auth.criticalbit.gg/login?redirect=https://hera-…/\`, sees "Don't have an account? Sign up", clicks, registers, and ends up at `/profile` instead of being bounced back to the consumer app.
Fix
Test plan
Adjacent
Issue #46 (display-name suggestions) covers the new-user-from-consumer-app flow at the UX level. With #47 + #46 both shipped, the flow feels right end-to-end: redirect preserved, optional name field at register, nudge on /profile if skipped.