9

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.

imjared
  • 19,492
  • 4
  • 49
  • 72

2 Answers2

21

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: "modifiedUser@example.com"
});
benomatis
  • 5,536
  • 7
  • 36
  • 59
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
1

You can use the Firebase Admin SDK for this, and you can just write some one-off code to make the change from your desktop machine if needed. The API documentation suggests that you can use updateUser() (Java, Node, etc) to get the job done.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441