-
Notifications
You must be signed in to change notification settings - Fork 936
Auth data is not persisted on React Native #6050
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @slapbox, thanks for reaching out. It looks like React Native persistence (which is backed by Async Storage) is not properly wired into the compatibility layer at the moment. I will take a look, but in the mean time, you can use Async Storage with the modular SDK (and use the |
Thanks for your reply! It seems like upgrading to remove compatibility fixed the issue, without any need to use |
Cool, thanks for the update! I'm going to keep this issue open for now until we address the bug in the compat layer |
Hi, I can't import getReactNativeLocalStorage from firebase/auth. import { initializeAuth, getReactNativePersistence } from "firebase/auth" it says that firebase/auth does not export a member getReactNativePersistence. I installed firebase through yarn with the command: "yarn add firebase" which installed version 9.6.10. The function is mentioned https://firebase.google.com/docs/reference/js/auth.md#getreactnativepersistence in the docs. |
@rahonix These can be imported from import { initializeAuth, getReactNativePersistence } from "firebase/auth/react-native" |
What worked for us before no longer works and we now had to implement the Edit: There's a very unfortunate side-effect that it triggers |
Hi @allotrop3, thanks for posting that -- that's the correct way to get that import @slapbox |
Actually on second thought, @slapbox would you please open the Fast Refresh problem as a separate issue? I don't want folks to be confused from the title of this one. I'm going to close this issue for now, but if anyone is still seeing problems with the |
New issue for Fast Refresh bug: #6231
I really hope it can be resolved because otherwise Firebase is a nightmare for mobile development. It's already making huge headaches for us on top of the substantial amount of work involved in upgrading to 9.x. This issue slows down our development by like 80% right now. |
For any future readers:
I had issues with the persistency, because I tried to import AsyncStorage in a destructured way ( { AsyncStorage } ) |
[REQUIRED] Describe your environment
9.6.7
auth
[REQUIRED] Describe the problem
After upgrading from
7.18.0
to9.6.7
(with compat helpers,) everything seems to work great, except authentication data is not persisted on React Native anymore. We've tried with React Native0.64.x
and0.65.x
with the same results.Authentication data is properly persisted when debugging is enabled (ie, when the authentication is saved to desktop browser storage.)
Steps to reproduce:
Authenticate user in React Native app, using JS SDK.
Relevant Code:
The text was updated successfully, but these errors were encountered: