Firebase Auth - User logins don't persist

#1

I’m using Firebase authentication (Email + pw) and everything seems to be working great (users can sign up / log in). However, if they quit the application completely (iOS) and then open it again, they have to sign in - is this a limitation of Expo? It seemed to work when I built the application only using React Native.

#2

This shouldn’t be a limitation of Expo. It’s unclear to me how Firebase is automatically persisting the logged-in-user state. Figuring that out would make it easier to diagnose what the cause of this could be.

1 Like
#3

Did you happened to use the version 4.5.1 of firebase?

It had a bug that made the logins expire when restarting the app. It’s fixed in 4.5.2.

More: https://github.com/firebase/firebase-js-sdk/issues/223

1 Like
#4

Thanks @ide and @jannevickholm, I got it to work by updating firebase and wrapping my sign in / login functions with:

firebase.auth().setPersistence(firebase.auth.Auth.Persistence.LOCAL).then(() => { //signin/login }