admin 管理员组

文章数量: 1086019

Firebase: The email address is already in use by another account. (auth/email-already-in-use).

This error is ing from firebase and everything works, but, i would like to diplay error without firebase name there, how can i do that?

Firebase: The email address is already in use by another account. (auth/email-already-in-use).

This error is ing from firebase and everything works, but, i would like to diplay error without firebase name there, how can i do that?

Share Improve this question edited Feb 5, 2022 at 15:04 Doug Stevenson 318k36 gold badges456 silver badges473 bronze badges Recognized by Google Cloud Collective asked Feb 5, 2022 at 8:33 Edin OsmicEdin Osmic 4462 gold badges11 silver badges29 bronze badges 2
  • 3 Wele to Stack Overflow. It is customary to include in your question the code you are working with so that we can see what you have so far and help you proceed with that. Please read: stackoverflow./help/how-to-ask – Doug Stevenson Commented Feb 5, 2022 at 15:05
  • Thank you, i will do better next time. – Edin Osmic Commented Feb 8, 2022 at 11:57
Add a ment  | 

3 Answers 3

Reset to default 3

Capture your error with error code :

if(errorCode == "auth/email-already-in-use"){
    alert("Email already in use")
}
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.");
    }
  });

you can just split your error message because the actual message is after the first space character.

error.substring(error.indexOf(' ') + 1);

本文标签:

Error[2]: Invalid argument supplied for foreach(), File: /www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm, Line: 58
File: /www/wwwroot/roclinux.cn/tmp/route_read.php, Line: 205, include(/www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm)
File: /www/wwwroot/roclinux.cn/tmp/index.inc.php, Line: 129, include(/www/wwwroot/roclinux.cn/tmp/route_read.php)
File: /www/wwwroot/roclinux.cn/index.php, Line: 29, include(/www/wwwroot/roclinux.cn/tmp/index.inc.php)