使用react-native制作一个简单的firebase auth应用。注册/登录工作正常,但是我无法退出以正常工作。
loginUser = (email,password) => {
try{
firebase.auth().signInWithEmailAndPassword(email, password).then(function(user){
console.log(user)
})
}
catch(error){
console.log(error.toString())
}
}
signOutUser = () => firebase.auth.signOut();
退出按钮很简单,因为:
<Button style={styles.button}
full
rounded
onPress={() => this.signOutUser()}
>
您的注销用户的函数被调用,signOutUser
但是deleteAccount
当您按下按钮时,您调用的函数名为。
尝试:
onPress={() => this.signOutUser()}
另外,您可能需要将signOutUser函数更改为:
firebase.auth().signOut().then(function() {
// Sign-out successful.
}).catch(function(error) {
// An error happened.
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句