Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6581

Firebase authentication is not persistent even when using onAuthStateChanged

$
0
0

I'm using react native w/ expo and redux toolkit, I created 2 apps and on the first one things are working as it should, I'am able to register and login using the app.

On the second app after successfully logging in with an account registered using the first app, the authentication state does not persist. Whenever I refresh my app, the onAuthStateChanged callback returns the user as null.

  onAuthStateChanged(auth, (user) => {    console.log("current-user: ", user); // null when I refresh the app    if (user) {      dispatch(setUser({ currentUser: user }));    }  });

Viewing all articles
Browse latest Browse all 6581

Latest Images

Trending Articles



Latest Images