Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

As an admin, can I modify a Firebase user's email address?

We had a user signup with an invalid email address (@gmail.comp) so as soon as he loses his session, he's going to be permanently locked out since password reset emails won't get to him.

We don't have "change your email" functionality built and even if we did, he's probably not aware his email address is wrong. Can I, as an admin, change the user's email address? It seems that firebase.auth().currentUser.updateEmail() would only work if my user triggered the request.

like image 200
imjared Avatar asked Mar 19 '19 19:03

imjared


People also ask

Can you change email in Firebase Auth?

You will also need to reauthenticate the login prior to calling this as Firebase requires a fresh authentication to perform certain account functions such as deleting the account, changing the email or the password.

How do I change my Firebase email?

Open your project in the Firebase console. Go to the Email Templates page in the Auth section. In any of the Email Types entries, click the pencil icon to edit the email template. Click customize action URL, and specify the URL to your custom email action handler.

Can you change user UID Firebase?

uid cannot be changed. You can create your own custom uid for users. You will need a users table which uses your custom uid rather than the one created by Firebase.


1 Answers

If you're using the Admin SDK you can update most properties of the user's account, including their email address. See the documentation on updating a user.

The simplest example (in Node.js) would be:

admin.auth().updateUser(uid, {
  email: "[email protected]"
});
like image 177
Frank van Puffelen Avatar answered Sep 28 '22 01:09

Frank van Puffelen