-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[firebase_auth_web] authentication status not persistent #1918
Comments
I have found the solution: |
Hi @tianhaoz95 |
@iapicca yes it worked for me. You can probably mark as fixed if that is the suggested approach. |
This is a bug if the implementations of the platform interfaces have different results. Just checked and the JavaScript SDK treats it as a property: https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/auth.js#L928 I think we should update the getCurrentUser function to track the initialization and use the fix above to wait for the first authChanged response whilst the library is still initializing. |
lgtm |
@iapicca what is left in this issue? Do we want to use it as a tracking bug for the JS SDK fix? |
Hi @tianhaoz95 @slightfoot is it ok for you if I close this? |
This fix cannot be put in the JS SDK. Assign this ticket to me. |
any updates on this issue ? |
Updates on this? |
@joaquini Maybe this is fixed with |
Hey 👋 The rework of the We also added support on web for configuring persistence, see: https://firebase.flutter.dev/docs/auth/usage#persisting-authentication-state For help migrating to the new plugins please see the new migration guide: https://firebase.flutter.dev/docs/migration |
Describe the bug
According to firebase auth doc, the default behavior of firebase auth persistency is
LOCAL
meaning it should persistent across refresh. However, that's not the case withfirebase_auth_web
.Setting the persistency manually did help either:
https://github.com/tianhaoz95/iwfp/blob/faaabf9788fc393888a66a7b864e582fca4b8952/iwfpapp/web/index.html#L12-L26
To Reproduce
Steps to reproduce the behavior:
firebase_auth
for web appExpected behavior
Users should still be signed in after refreshing the tab.
Additional context
Fun fact: it persists during development, but not when the app is compiled.
The text was updated successfully, but these errors were encountered: