Skip to content

fix(auth): set status params correctly on auth redirect URLs - #413

Merged
omegascorp merged 1 commit into
modelence:mainfrom
poojagosika:fix/auth-redirect-query-string
Oct 27, 2026
Merged

omegascorp merged 1 commit into
modelence:mainfrom
poojagosika:fix/auth-redirect-query-string

Conversation

@poojagosika

@poojagosika poojagosika commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

The email verification, magic link and password reset routes built their
redirects as ${url}?status=..., so a configured redirect URL that already
had a query string got a second ? and the app couldn't read status.

Add a setQueryParams helper in auth/utils and use it at all four call sites:

  • joins with & when the URL already has a query string
  • replaces existing status / message values instead of duplicating them
  • for URLs with a #fragment (hash-router paths like /#/verified), puts the
    params inside the fragment, so those redirects stay exactly as they are today
  • works on relative URLs and keeps the existing encodeURIComponent encoding,
    so URLs without a query string redirect exactly as before

Tests: unit tests for the helper, plus a regression test for the verification
route using the example URL from the issue.

Fixes #391

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/modelence/src/auth/utils.ts Resolved
Redirect URLs that already had a query string got a second '?', so the app couldn't read status. Add setQueryParams, which joins with '&', replaces existing status/message values, and keeps hash-router URLs (/#/path) working as before.

Fixes modelence#391
@poojagosika
poojagosika force-pushed the fix/auth-redirect-query-string branch from 25e93a2 to 250cd10 Compare October 14, 2026 14:39

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 250cd10. Configure here.

Comment thread packages/modelence/src/auth/utils.ts Resolved
@poojagosika poojagosika changed the title fix(auth): append status params correctly when redirect URL has a query string fix(auth): set status params correctly on auth redirect URLs Oct 14, 2026

@omegascorp omegascorp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@omegascorp
omegascorp merged commit afcfe7a into modelence:main Oct 27, 2026
4 checks passed
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.

Auth redirect URLs that already have a query string get a second '?' (status parameter lost)

2 participants