Making a simple firebase auth app with react-native. Register/sign in works just fine, but I can't get the sign out to work properly.
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();
The sign out button is easy as this:
<Button style={styles.button}
full
rounded
onPress={() => this.signOutUser()}
>
Your function to sign users out is called signOutUser
but you call a function named deleteAccount
when your button is pressed.
Try:
onPress={() => this.signOutUser()}
Also you may need to change the signOutUser function to:
firebase.auth().signOut().then(function() {
// Sign-out successful.
}).catch(function(error) {
// An error happened.
});
Your function is named signOutUser
in your code, but your HTML is trying to call a function named deleteAccount
.
If you have a different deleteAccount
we'll need you to show us that too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With