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
Unfortunately we couldn't reproduce this issue. We've created an verifiable example here. Could you alter it to reproduce the issue that you're seeing and let us know what the required changes are? Thanks!
Hey @dpschramm. 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!
Operating System
macOS 14.5 (23F79)
Environment (if applicable)
Chrome 129.0.6668.60 (arm64), Vite 5.4.10, React 18.3.1
Firebase SDK Version
11.0.1
Firebase SDK Product(s)
Auth
Project Tooling
React app built with Vite
Detailed Problem Description
I expected auth state to persist by default as I am creating a web app with React and Vite. However, the auth state is cleared on page refresh.
I am accessing the auth state using onAuthStateChanged(). It never fires an event with a non-null user by default.
Setting the persistence setting fixes this:
I'm filing this bug as the default behaviour does not match the documentation in: https://firebase.google.com/docs/auth/web/auth-state-persistence#web
Steps and code to reproduce issue
Expected: receive an onAuthStateChanged() callback with a valid user, if the user was previously signed in.
Observed: never receive an onAuthStateChanged() callback with a valid user. Setting persistence manually during initializeAuth fixes this.
The text was updated successfully, but these errors were encountered: