You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to ask for advise on what is the most reliable way to switch from the firebase/auth to @react-native-firebase/auth without user losing the session between the app upgrades.
Currently I am using AsyncStorage as a persistor layer in the following way:
import AsyncStorage from "@react-native-async-storage/async-storage";
import { getAuth } from "@react-native-firebase/auth";
import { setReactNativeAsyncStorage } from "@react-native-firebase/app";
...
setReactNativeAsyncStorage(AsyncStorage);
...
export const auth = getAuth(app);
When tried the upgrade the session persistence seemed to work, as the user didn't get logged out but I experienced some odd behaviour as well:
I experienced that in some cases between the upgrades the session persisted but it was a different user (?). I use several test users, I have regular login as well as Apple/Google auth. As if the tokens have been stored independently and one SDK read it from different place than the other
occasionally the Firestore queries were failing (can't say 100% why but could be the permission-denied error). Btw I have migrated also the firestore related module (firebase/firestore to @react-native-firebase/firestore)
the offline behaviour that I expected to be switched on by default in native SDK doesn't seem to work (maybe a separate issue here)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to ask for advise on what is the most reliable way to switch from the
firebase/auth
to@react-native-firebase/auth
without user losing the session between the app upgrades.Currently I am using AsyncStorage as a persistor layer in the following way:
After moving to native SDK I have now:
When tried the upgrade the session persistence seemed to work, as the user didn't get logged out but I experienced some odd behaviour as well:
firestore
related module (firebase/firestore
to@react-native-firebase/firestore
)Beta Was this translation helpful? Give feedback.
All reactions