[GH-ISSUE #136] feat: add a change email flow #8143

Closed
opened 2026-04-13 03:13:12 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @eNiiju on GitHub (Oct 10, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/136

A user requesting to change their email address should first be confirmed by the old email address (if this address is verified). Then, We could call sendVerificationEmail for the new email address if we want to.

Originally created by @eNiiju on GitHub (Oct 10, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/136 A user requesting to change their email address should first be confirmed by the old email address (if this address is verified). Then, We could call `sendVerificationEmail` for the new email address if we want to.
GiteaMirror added the locked label 2026-04-13 03:13:12 -05:00
Author
Owner

@eNiiju commented on GitHub (Oct 18, 2024):

Shouldn't there be an option to first confirm the change by the old email address, in case the account got compromised? (only if that old email address was verified of course)

<!-- gh-comment-id:2422877276 --> @eNiiju commented on GitHub (Oct 18, 2024): Shouldn't there be an option to first confirm the change by the old email address, in case the account got compromised? (only if that old email address was verified of course)
Author
Owner

@Bekacru commented on GitHub (Oct 18, 2024):

just updated the docs. The flow is

  • User requests to change their email.
  • A verification link is sent to their current email address.
  • The user clicks the link, which contains a token with the new email in its payload.
  • The email field is updated, and a verification email is sent to the new address.
<!-- gh-comment-id:2422910430 --> @Bekacru commented on GitHub (Oct 18, 2024): just updated the docs. The flow is - User requests to change their email. - A verification link is sent to their current email address. - The user clicks the link, which contains a token with the new email in its payload. - The email field is updated, and a verification email is sent to the new address.
Author
Owner

@eNiiju commented on GitHub (Oct 18, 2024):

Thanks for the update.
I've tried it and it looks nice, but currently the verification link to the current email address is still sent even if this address hasn't been verified.
If a user entered a wrong email address at first, they are blocked and can't change email now.

<!-- gh-comment-id:2423232624 --> @eNiiju commented on GitHub (Oct 18, 2024): Thanks for the update. I've tried it and it looks nice, but currently the verification link to the current email address is still sent even if this address hasn't been verified. If a user entered a wrong email address at first, they are blocked and can't change email now.
Author
Owner

@Bekacru commented on GitHub (Oct 18, 2024):

thanks. good point. now if email isn't verified the email will be changed in place withtout requireing verification process.

<!-- gh-comment-id:2423296019 --> @Bekacru commented on GitHub (Oct 18, 2024): thanks. good point. now if email isn't verified the email will be changed in place withtout requireing verification process.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8143