There is no user record corresponding to this identifier. The user may have been deleted

Viewed 7274

There is no user record corresponding to this identifier. The user may have been deleted.

export const createEmployee = ({ email, password}) => {
  return (dispatch) =>{`
    firebase.auth().createUserWithEmailAndPassword ( email,password )
    .then(
      firebase.auth().signInWithEmailAndPassword( email,password )
      .then(Actions.profile())
    )
  };
};
1 Answers

According to the official documentation, after the success of createUserWithEmailAndPassword the user is automatically signed-in.

Create a new account by passing the new user's email address and password to createUserWithEmailAndPassword:

firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  // ...
});

If the new account was created, the user is signed in automatically. Have a look at the Next steps section below to get the signed in user details. [...]

Look also at this SO question.

So in your promise you can just get you already authenticated user like that:

var user = firebase.auth().currentUser;

No need to make signInWithEmailAndPassword call.

Related