[GH-ISSUE #415] Email verification redirectTo is improperly composed #16892

Closed
opened 2026-04-15 14:52:10 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @svaraborut on GitHub (Nov 4, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/415

Describe the bug
The redirectTo field of authClient.forgetPassword({ ... redirectTo: '/auth/login' }) has an inconsistent behavior
with callbackURL within other methods. It is a perfectly resolvable relative URL, but it is not resolved properly by the
API. To the email this URL is sent
http://localhost:4444/api/auth/reset-password/...?callbackURL=/auth/login which upon visit redirects
me to http://localhost:4444/api/auth/auth/login?token=J7pJqT6tmM6vWzg6vq427 which is wrong.

Expected behavior
The URL shall be resolved properly

Originally created by @svaraborut on GitHub (Nov 4, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/415 **Describe the bug** The `redirectTo` field of `authClient.forgetPassword({ ... redirectTo: '/auth/login' })` has an inconsistent behavior with `callbackURL` within other methods. It is a perfectly resolvable relative URL, but it is not resolved properly by the API. To the email this URL is sent `http://localhost:4444/api/auth/reset-password/...?callbackURL=/auth/login` which upon visit redirects me to `http://localhost:4444/api/auth/auth/login?token=J7pJqT6tmM6vWzg6vq427` which is wrong. **Expected behavior** The URL shall be resolved properly
GiteaMirror added the locked label 2026-04-15 14:52:10 -05:00
Author
Owner

@svaraborut commented on GitHub (Nov 4, 2024):

I can solve this

<!-- gh-comment-id:2455389671 --> @svaraborut commented on GitHub (Nov 4, 2024): I can solve this
Author
Owner

@Bekacru commented on GitHub (Nov 4, 2024):

I can solve this

go for it

<!-- gh-comment-id:2455398487 --> @Bekacru commented on GitHub (Nov 4, 2024): > I can solve this go for it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16892