Update user email (Email/password authentication)

How to update the email used by a user in Email/Password authentication?

In my app I have a settings panel which allows the user to update his/her username, email address and password. I am able to change the email address stored in custom user data, but not the one used for authentication.

2 Likes

I am also interested in this. If the user changes his email or simply wants to transfer his account to a new domain, changing the login email is necessary.

Hi @Marco_Ancona and @Jean-Baptiste_Beau,

This option is currently cannot be done via email/password Auth in Realm, the only way with this provider is create a new user and associate to user data.

Having said that, you may consider using custom function authentication and store encrypted passwords in the Atlas deployment:
https://docs.mongodb.com/realm/authentication/custom-function

Here you are in full control of the user credentials as long as the process return the same unique identifier

Encryption can be done via util.crypto
https://docs.mongodb.com/realm/functions/utilities#cryptography--utils.crypto-

Thanks
Pavel