我有一个叫firebase.createUserWithEmailAndPassword
的小型reactjs应用程序。呼叫无问题,我的新用户帐户已创建。但随后应用程序会立即死于firebase文件auth.js的异常,如上所示。奇怪的是当时和捕获两者都运行。
static register(userId, password, fullName){
return fbAuth.createUserWithEmailAndPassword(userId, password);
}
static register(userId, password, userName){
return (dispatch) => {
return AuthApi
.register(userId, password, userName)
.then((response, reject) => {
debugger;
const thisUserRef = fbDbUser.push({
fullName: userName,
userId: userId
});
dispatch({type: AuthActions.GOT_USER_SUCCESS, payload: thisUserRef});
})
.catch(error => {
debugger;
let registerErrorCode = error.code;
let registerErrorMsg = error.message;
toastr.error(registerErrorMsg);
dispatch({type: AuthActions.GOT_USER_FAIL, payload: null});
});
};
}