-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth not persisting in React Native #8798
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
I've noticed the NO_PERSISTANCE_WARNING is getting logged if getAuth() is called before initializeAuth(). Whilst I don't think this is the issue in my case, would it be more appropriate to log a wanring message such as I might be missing something but logging the Have raised a PR to demo the change |
Hi @stretch0, thanks for submitting this issue with the reproduction app!
|
@stretch0 If you follow the resolution of an import to |
Not quite sure I follow your suggestion here. Are you saying to update the import in my firebaseConfig.ts file to be some like
Or are you saying to update the bundler to override the import of Do you have an example of this being done elsewhere? I have posted on StackOverflow trying to get help too but based on no responses, this doesn't seem to be well known |
You need to make the bundler resolve The resolution path should be something like Since our team is not very familiar with Expo/Metro, we don't have any examples on how to do this. |
Hey @stretch0. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @stretch0 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
Operating System
Android 14 API 34
Environment (if applicable)
React Native
Firebase SDK Version
11.3.1
Firebase SDK Product(s)
Auth
Project Tooling
React Native using Expo
Detailed Problem Description
Auth doesn't persist across app refreshes.
I login to my app using a self hosted login form that calls
signInWithEmailAndPassword
and can successfully log in. I can see the user details all ok.When I refresh the app, the auth state is lost and currentUser is null.
I get the following log in my console
I was under the impression auth should persist by default.
Also
getReactNativePersistence
doesn't seem to be exported fromfirebase/auth
package so I couldn't add this if I tried.Steps and code to reproduce issue
Sample repo here: https://github.com/stretch0/react-native-test-app
The text was updated successfully, but these errors were encountered: