gpt4 book ai didi

firebase - 没有与该标识符对应的用户记录。该用户可能已被删除

转载 作者:行者123 更新时间:2023-12-03 21:21:16 25 4
gpt4 key购买 nike

没有该标识符对应的用户记录。该用户可能已被删除。

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

最佳答案

根据official documentation ,在 createUserWithEmailAndPassword 成功后,用户自动登录

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. [...]

也看看这个 SO question .

因此,在您的 promise 中,您可以像这样获得已经过身份验证的用户:

var user = firebase.auth().currentUser;

无需调用 signInWithEmailAndPassword

关于firebase - 没有与该标识符对应的用户记录。该用户可能已被删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53864507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com