For most websites, the user's email is the primary mechanism for authenticity. You sign up with your email, password reset involves the email, and often you sign in with your email.
For various reasons, users may wish to maintain their account data, but change their email address. There are a few important considerations for managing this:
There are a few ways to address these concerns. Here are a few things you could do (some in combination)
The ultimate secure approach would be:
This has a few problems:
If you really needed that level of security, you could require 2FA and users could reach out to support if they don't have access to the old email to plead their case.
However, there's a middle-ground:
This strikes a good balance of being easy for the user, reducing the number of support requests, and security.
We're going to require recent (within the last 2 hours) verification of the two-factor code if the user has it enabled, require confirmation of the new address, and notify the old address of the change.
This will require supporting a mechanism for tracking when the last 2FA code was entered (just storing the time in the session). This will also require a new verification for confirming the new address (utilizing existing verification utilities we have for onboarding the user in the first place).
It's a little bit more complicated than just letting the user change their email address, but will hopefully reduce the problems described.
Edit this page on