【发布时间】:2017-03-24 02:18:36
【问题描述】:
在成功创建用户注册过程中,当firebase-authentication返回空语句时,我如何管理执行语句..
firebase.auth().createUserWithEmailAndPassword(email, pass).catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
if(errorCode == "auth/email-already-in-use"){ //condition working
alert(errorMessage);
}
else if(errorCode == null){ //this condition not working
alert("Registration Successfully");
}
else{ //condition working
alert("Weak Password");
}
});
【问题讨论】:
-
return null 语句是什么意思?您必须添加 .then(function(user){//successful}).catch(function(error){});如果你想捕捉用户创建成功。
标签: javascript html cordova firebase firebase-authentication