react-native-firebase-auth
react-native-firebase-auth copied to clipboard
How check if login is correct?
Hi, thanks for your repo, congratulations.
I have been able to authenticate with Facebook and Google, but I can not check if the user has authenticated correctly to send it to another screen
How use this.onLogin, this.onUserChange, this.onLogout, this.emailVerified, this.onError
FireAuth.setup(this.onLogin, this.onUserChange, this.onLogout, this.emailVerified, this.onError);
The above are all intended to be callback functions, onLogin could be something like this in your component:
onLogin = (user) => {
//Push using whatever router you're using with the user as a param (or keep it in a store) depending on your setup
routerPush(user);
}
onError = (err)=>this.setState({isLoading:false,error})