Skip to content

fix: default returnTo to current URL in RequireAuth when not provided - #8

Merged
yogeshchoudhary147 merged 2 commits into
mainfrom
fix/require-auth-return-to
Aug 18, 2026
Merged

fix: default returnTo to current URL in RequireAuth when not provided#8
yogeshchoudhary147 merged 2 commits into
mainfrom
fix/require-auth-return-to

Conversation

@yogeshchoudhary147

Copy link
Copy Markdown
Contributor

Problem

RequireAuth called loginWithRedirect({ returnTo }) with no default value. When no returnTo prop was passed (the common case), users always landed on / after login instead of the page they originally tried to visit.

Fix

Default returnTo to window.location.pathname + window.location.search so the user is returned to the correct page after authentication.

@yogeshchoudhary147
yogeshchoudhary147 merged commit 5180fac into main Aug 18, 2026
4 checks passed
@yogeshchoudhary147
yogeshchoudhary147 deleted the fix/require-auth-return-to branch August 18, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants