[GH-ISSUE #5614] How to Resend Expired Change Email Verification #18933

Closed
opened 2026-04-15 17:40:00 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @meeshan-dev on GitHub (Oct 27, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5614

Hello,

Sorry to bother you here — I didn’t get a response on Discord.

My question:
How can I resend an email verification link for a “change email” request if the previous link has expired or failed for any reason?

Thanks in advance for your help!

Originally created by @meeshan-dev on GitHub (Oct 27, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5614 Hello, Sorry to bother you here — I didn’t get a response on Discord. My question: How can I resend an email verification link for a “change email” request if the previous link has expired or failed for any reason? Thanks in advance for your help!
GiteaMirror added the locked label 2026-04-15 17:40:00 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 27, 2025):

There’s no built-in “resend” endpoint for expired change email verification links in better-auth, but you can implement this by simply triggering the same change email request again (for example, via a “Resend verification” button in your UI). This will call your configured sendChangeEmailVerification handler and generate a new verification link with a fresh token, regardless of whether the previous link expired or failed. This pattern is supported by the core implementation and is how most teams handle resends in better-auth (see code reference).

If you want to prevent abuse, add a cooldown or rate limit to the resend action on your frontend or backend. There’s no built-in rate limiting for this in better-auth, so you’ll need to implement it yourself if needed (see discussion).

If you need a code example or want to discuss best practices for the resend button, let me know!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3451832968 --> @dosubot[bot] commented on GitHub (Oct 27, 2025): <!-- Answer --> There’s no built-in “resend” endpoint for expired change email verification links in better-auth, but you can implement this by simply triggering the same change email request again (for example, via a “Resend verification” button in your UI). This will call your configured sendChangeEmailVerification handler and generate a new verification link with a fresh token, regardless of whether the previous link expired or failed. This pattern is supported by the core implementation and is how most teams handle resends in better-auth ([see code reference](https://github.com/better-auth/better-auth/blob/97cd4a205957002568915b2f8b85c2b9c8de76d9/packages/better-auth/src/api/routes/update-user.ts)). If you want to prevent abuse, add a cooldown or rate limit to the resend action on your frontend or backend. There’s no built-in rate limiting for this in better-auth, so you’ll need to implement it yourself if needed ([see discussion](https://github.com/better-auth/better-auth/issues/788#issuecomment-2564396916)). If you need a code example or want to discuss best practices for the resend button, let me know! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/64fc33da-02a7-45d8-a1ba-a6861cb62c9c?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/5614)
Author
Owner

@Bekacru commented on GitHub (Oct 28, 2025):

The bot response should suffice. Feel free to ask if you have additional question

<!-- gh-comment-id:3454290773 --> @Bekacru commented on GitHub (Oct 28, 2025): The bot response should suffice. Feel free to ask if you have additional question
Author
Owner

@meeshan-dev commented on GitHub (Oct 28, 2025):

hi @Bekacru , chat gpt said, change email process only change email and to verify we need another process, on email change successfully i show message that signout and sign back in with google or email otp to complete verification. is this the process?

<!-- gh-comment-id:3455183053 --> @meeshan-dev commented on GitHub (Oct 28, 2025): hi @Bekacru , chat gpt said, change email process only change email and to verify we need another process, on email change successfully i show message that signout and sign back in with google or email otp to complete verification. is this the process?
Author
Owner

@luist18 commented on GitHub (Nov 4, 2025):

Hi @Bekacru, signing up with email again requires using the same pair email/password which makes creating the solution from the bot difficult if you just want to have a resend button to resend the confirmation email.

<!-- gh-comment-id:3485744574 --> @luist18 commented on GitHub (Nov 4, 2025): Hi @Bekacru, signing up with email again requires using the same pair email/password which makes creating the solution from the bot difficult if you just want to have a resend button to resend the confirmation email.
Author
Owner

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

@luist18 I might be missing the use case, but here’s my current understanding of the situation:
You send a change email verification request, and the link either expires or doesn’t work for some reason. The user then wants to resend the request.

If we have a resend functionality, we’d need to track from which email to which email the change was requested. If they’ve made multiple requests from different emails, we’d need to know which one to resend.

Given that, if a user wants to resend the change email verification, I think it’s reasonable to ask them to enter the new email again instead of providing a simple “resend” button

<!-- gh-comment-id:3486951516 --> @Bekacru commented on GitHub (Nov 4, 2025): @luist18 I might be missing the use case, but here’s my current understanding of the situation: You send a change email verification request, and the link either expires or doesn’t work for some reason. The user then wants to resend the request. If we have a resend functionality, we’d need to track from which email to which email the change was requested. If they’ve made multiple requests from different emails, we’d need to know which one to resend. Given that, if a user wants to resend the change email verification, I think it’s reasonable to ask them to enter the new email again instead of providing a simple “resend” button
Author
Owner

@meeshan-dev commented on GitHub (Nov 6, 2025):

hi @Bekacru and @luist18, actually i was not using api correctly,
correct method is, when user request for change email, new email does not change immediatly, so user can again input new email to get verification link and at server we must send verification email to current verified email. when current email verify update email change, user need to verify new email with separate method in which user can ask many time OTP. if new email was incorrect, user can update, it will immediatly change due to unverified new email.

Better-auth explicity tell users that

  • change email verification
  • verify new email

both are separate steps.

<!-- gh-comment-id:3497814379 --> @meeshan-dev commented on GitHub (Nov 6, 2025): hi @Bekacru and @luist18, actually i was not using api correctly, correct method is, when user request for change email, new email does not change immediatly, so user can again input new email to get verification link and at server we must send verification email to current verified email. when current email verify update email change, user need to verify new email with separate method in which user can ask many time OTP. if new email was incorrect, user can update, it will immediatly change due to unverified new email. Better-auth explicity tell users that - change email verification - verify new email both are separate steps.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18933