FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.5k stars 400 forks source link

Cannot get auth flow working correctly with persistence. #614

Open MWTuttle opened 3 months ago

MWTuttle commented 3 months ago

Version info

React: 18.2.0

Firebase: 10.7.1

ReactFire: 4.2.3

Expo: 50.0.15

Other (e.g. Node, browser, operating system) (if applicable):

Test case

I'm trying to setup the AuthProvider with an auth object to initialize it. If I use 'getAuth(app)' I get a warning that says I'm using authentication without persistence and says I should use:

initializeAuth(app, { persistence: getReactNativePersistence(AsyncStorage), });

If I use that though, I get a firebase error saying auth is already initialized ('auth/already-initialized').