[GH-ISSUE #3060] URL generated from authClient.requestPasswordReset missing callbackURL query param #9454

Closed
opened 2026-04-13 04:55:25 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @projectplaywright0 on GitHub (Jun 17, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3060

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Run the code on the client side to request password reset.

const { data, error } = await authClient.requestPasswordReset({
            email: email.value,
            callbackURL: "/reset-password",
        });

Current vs. Expected behavior

Expected URL: https://<host>/api/auth/reset-password/<token>?callbackURL=<callbackURL>
Current URL: https://<host>/api/auth/reset-password/<token>?callbackURL=

Current behavior: Since the callbackURL is not provided, the better-auth route will return "INVALID_TOKEN" since it checks the existence of the callbackURL here: fd62eba1d0/packages/better-auth/src/api/routes/reset-password.ts (L286)

What version of Better Auth are you using?

1.2.9

Provide environment information

- OS: Mac
- Browser: Brave 1.78.94

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

Client, Backend

Auth config (if applicable)

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

Additional context

No response

Originally created by @projectplaywright0 on GitHub (Jun 17, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3060 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Run the code on the client side to request password reset. ``` const { data, error } = await authClient.requestPasswordReset({ email: email.value, callbackURL: "/reset-password", }); ``` ### Current vs. Expected behavior Expected URL: `https://<host>/api/auth/reset-password/<token>?callbackURL=<callbackURL>` Current URL: `https://<host>/api/auth/reset-password/<token>?callbackURL=` Current behavior: Since the callbackURL is not provided, the better-auth route will return "INVALID_TOKEN" since it checks the existence of the callbackURL here: https://github.com/better-auth/better-auth/blob/fd62eba1d0ec71b3abb17ece92a4aae0c3c85270/packages/better-auth/src/api/routes/reset-password.ts#L286 ### What version of Better Auth are you using? 1.2.9 ### Provide environment information ```bash - OS: Mac - Browser: Brave 1.78.94 ``` ### Which area(s) are affected? (Select all that apply) Client, Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 04:55:25 -05:00
Author
Owner

@Kinfe123 commented on GitHub (Jun 18, 2025):

you can request for password reset like this -

const { data, error } = await authClient.requestPasswordReset({
  email: "test@example.com",
  redirectTo: "/reset-password",
});
<!-- gh-comment-id:2982248618 --> @Kinfe123 commented on GitHub (Jun 18, 2025): you can request for password reset like this - ```ts const { data, error } = await authClient.requestPasswordReset({ email: "test@example.com", redirectTo: "/reset-password", }); ```
Author
Owner

@projectplaywright0 commented on GitHub (Jun 18, 2025):

@Kinfe123 Thanks!

<!-- gh-comment-id:2982604959 --> @projectplaywright0 commented on GitHub (Jun 18, 2025): @Kinfe123 Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9454