Reputation: 27
I was just wondering if it's possible to have email and password auth with react native? Also is there any tutorials out there for this topic?
Upvotes: 1
Views: 615
Reputation: 3081
The following library allows you to easily do this: https://github.com/invertase/react-native-firebase
Once signed in, auth state is persisted across app restarts/boots as it interacts with the native SDKs. On app boot, simply do the following to know whether the user is already signed in or not:
componentDidMount() {
firebase.auth().onAuthStateChanged((user) => {
console.log(user);
});
}
Upvotes: 2