Reset Password URL doesn't pass multiple query params #1170

Closed
opened 2026-03-13 08:26:22 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @isnifer on GitHub (May 6, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Call forgetPassword method with redirectTo parameter including 2 query parameters, e.g. http://localhost:3000/setNewPassword?foo=bar&baz=qux

Current vs. Expected behavior

Current: Second parameter is missing (baz) since callbackURL is not encoded and it's interpret as a sibling for callbackURL (not as part of it) — http://localhost:3000/setNewPassword?foo=bar&token=bla-bla-bla
Expected: All passed query parameters passed to Set new Password URL inside callbackURLhttp://localhost:3000/setNewPassword?foo=bar&baz=qux&token=bla-bla-bla

What version of Better Auth are you using?

1.2.7

Provide environment information

- macOS: Darwin 24.5.0 arm64 arm
- Browser: Firefox/Chrome/Safari (it doesn't matter)

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @isnifer on GitHub (May 6, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Call `forgetPassword` method with `redirectTo` parameter including 2 query parameters, e.g. `http://localhost:3000/setNewPassword?foo=bar&baz=qux` ### Current vs. Expected behavior Current: Second parameter is missing (`baz`) since callbackURL is not encoded and it's interpret as a sibling for `callbackURL` (not as part of it) — `http://localhost:3000/setNewPassword?foo=bar&token=bla-bla-bla` Expected: All passed query parameters passed to `Set new Password` URL inside `callbackURL` — `http://localhost:3000/setNewPassword?foo=bar&baz=qux&token=bla-bla-bla` ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash - macOS: Darwin 24.5.0 arm64 arm - Browser: Firefox/Chrome/Safari (it doesn't matter) ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
Author
Owner

@Kinfe123 commented on GitHub (May 28, 2025):

thanks! i have included your commit as well.

@Kinfe123 commented on GitHub (May 28, 2025): thanks! i have included your commit as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1170