Chris Manfredi
Chris Manfredi

Reputation: 27

React Native Firebase Auth

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

Answers (1)

Alias
Alias

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

Related Questions