Firebase: The email address is already in use by another account. (auth/email-already-in-use).
This error is coming from firebase and everything works, but, i would like to diplay error without firebase name there, how can i do that?
CodePudding user response:
Capture your error with error code :
if(errorCode == "auth/email-already-in-use"){
alert("Email already in use")
}
CodePudding user response:
firebase.auth().createUserWithEmailAndPassword(email, password)
.then((userCredential) => {
// Signed in
var user = userCredential.user;
// ...
})
.catch((error) => {
if (error.code == "auth/email-already-in-use") {
alert("The email address is already in use");
} else if (error.code == "auth/invalid-email") {
alert("The email address is not valid.");
} else if (error.code == "auth/operation-not-allowed") {
alert("Operation not allowed.");
} else if (error.code == "auth/weak-password") {
alert("The password is too weak.");
}
});
