Best Practice - Logging In - Using email or username?

I see the default login process uses the person’s email address as the “user name”. If the user wanted to change their email address, does the original email still remain as their sign in “user name”?

Thanks,

Josh

Hi @admin85

Thank you for reaching out to us!

Once the email address of an Auth0 user is changed, the new address replaces the old one from that point onward and the user is no longer able to use their old email address to access the account.

Depending on the integration for email change, it could lead to user account lockouts. The safest way to handle such cases is outlined in our documentation to Update Dashboard User Email Addresses, which in summary requires the creation of a new user account with the correct email address and deleting the old account once the user accesses the new one.

I warmly recommend checking out the following topic Change user email , as the steps outlined by my colleague should provide a robust outline of the process, even as the post is little old at this point.

Hope this helped and please reach out to us for any other issues or requests!

Have a great weekend ahead!
Gerald

1 Like

Hi Gerald,

Thanks for providing insight into the process(es) involved with changing a user’s email address!

I definitely want to avoid any possible issues that may arise from the user changing their email address. Ideally, I want to maintain the original account if possible as I’ll be using the Auth0 id (ClaimTypes.NameIdentifier ) value as key for any user-specific data being stored. I’m assuming this would change as well when a new account is created with the updated email?

I see Auth0 has a “username” option to use as their login versus the email address. I’m thinking that might be the only way to maintain the integrity of the original account while allowing the user to change their email. However, it appears John from this post is advising against using a “username” instead of an email as the login, but I’m not sure why…

Just wanted to determine the best approach for maintaining the user’s Auth0 id (ClaimTypes.NameIdentifier ) at the time of creation while allowing them to update their email (or other related info) when needed.

Thanks,

Josh