-
Notifications
You must be signed in to change notification settings - Fork 893
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 9.6 in web worker: auth.onAuthStateChanged called once, user always null #5791
Comments
Possibly related: #5370 - except it explicitly mentions that firebase.auth().onAuthStateChanged does work when using the compat version:
Update, some additional info: I've tried a couple of older versions (9.5, 9.4.1, 9.2.0, 9.0.2 and 9.0.0) and none of these versions worked as I expect. I also tested if the I noticed that the fetches for getAccountInfo are not executed for the worker, only for the main thread. As soon as I roll back to 8.10.0, I see the request happening for the worker: https://www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo?key=XYZ |
Thanks for the detail folks. The linked PR should fix the issue and will be available in a release or two. Keep an eye on the changelogs! :) |
The fix is live in 9.6.2, thanks! |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
I have a web app where auth is handled in a web worker. I use Comlink to call methods in the worker from the main thread.
I use firebase-auth-ui 6.0.0 for the (you guessed it) auth ui.
Find the relevant example code below. (note: I've extracted and simplified the code so there may be a typo/etc in there)
Before I switched to Firebase 9 (compat), this worked fine.
After uprading from 8.10 to 9.6, the
onAuthStateChanged
callback is called once with the user object = null. Since I was already logged in before (prior to upgrading to 9.6), I expect the callback to be called with a User object.At this point my app loads the auth-ui and displays it. When I try to (re)log in using auth-ui, the callback is never called with the user object. From what I can tell, the auth-ui library does successfully log me in, but nothing happens in my web app.
Reloading the web app doesn't help either. I also tried clearing the application data (Dev tools > Application > Storage > Clear site data (with every option checked)).
Relevant Code:
The text was updated successfully, but these errors were encountered: