react-native-firebase-auth icon indicating copy to clipboard operation
react-native-firebase-auth copied to clipboard

How check if login is correct?

Open es11400 opened this issue 9 years ago • 1 comments

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

es11400 avatar May 25 '17 11:05 es11400

 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})

kyle-ssg avatar Aug 18 '17 15:08 kyle-ssg