Yuuta Moriyama
Yuuta Moriyama

Reputation: 459

Re-use email for firebase authentication development purpose

firebase email authentication use firebase.auth().createUserWithEmailAndPassword(email, password) and it needs email for authentication.

For development we need to execute this command again and again, but once the authentication succeed, next time with the same email address, createUserWithEmailAndPassword fail.

But for test I want to have account which wont become error even if t>>hat authentication is second time

Is there some way to create an account which succeed createUserWithEmailAndPassword many times?

Upvotes: 1

Views: 117

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317720

Once you've created an account with an email address, you can't create it again without first deleting it. From the linked documentation:

You can delete a user account with the delete method. For example:

var user = firebase.auth().currentUser;

user.delete().then(function() {
  // User deleted.
}).catch(function(error) {
  // An error happened.
});

Upvotes: 1

Related Questions