Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: use localStorage for Stytch return URL - #559

#559
Open
paulvanbrenk wants to merge 1 commit into
maintinytoolsllc/ai-patch-notes:mainfrom
fix/stytch-redirect-urltinytoolsllc/ai-patch-notes:fix/stytch-redirect-urlCopy head branch name to clipboard
Open

fix: use localStorage for Stytch return URL#559
paulvanbrenk wants to merge 1 commit into
maintinytoolsllc/ai-patch-notes:mainfrom
fix/stytch-redirect-urltinytoolsllc/ai-patch-notes:fix/stytch-redirect-urlCopy head branch name to clipboard

Conversation

@paulvanbrenk

Copy link
Copy Markdown
Collaborator

Summary

  • Stop appending returnUrl as a query param to Stytch redirect URLs — Stytch requires exact URL matches including query params, which breaks OAuth login
  • Store return URL in localStorage before initiating auth, read it back in /authenticate
  • Falls back to query param for backwards compat with any in-flight magic links

Trade-off

If a user opens a magic link on a different device, they'll land on / instead of the original page. This is acceptable — cross-device return URL preservation would require server-side state.

🤖 Generated with Claude Code

Stytch requires exact match on redirect URLs including query params,
which breaks OAuth login when returnUrl is appended. Store the return
URL in localStorage instead and read it back after authentication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.