Closed tibs245 closed 3 years ago
Hmm that's interesting, I am running in the same issue, but not constantly. Even your workaround does not seem to work all the time for me...
I think we should be able to fix this directly in the module and also add the FIREBASE_AUTH_EMULATOR_HOST env variable if emulators are activated, without you having to do it manually.
I'll need to have a closer look at this sometime but won't have time this weekend - Let me know if you find out more!
For my side, This problem is constantly and my solution work. I have test 2 days for see if I have the same problem of you but I don't have.
If you have more information when my solution do not work for you and may be how I can reproduce it. I can search a global solution
Hmm that's interesting, I am running in the same issue, but not constantly. Even your workaround does not seem to work all the time for me...
I think we should be able to fix this directly in the module and also add the FIREBASE_AUTH_EMULATOR_HOST env variable if emulators are activated, without you having to do it manually.
I'll need to have a closer look at this sometime but won't have time this weekend - Let me know if you find out more!
Any updates on this yet?
I have the same issue...can not use the emulator at all with this bug the fix does not work for me, the file is regenerated when restarted
I'm also having the same issue: "nuxt": "^2.15.3", "@nuxtjs/firebase": "^7.4.1", dev: "firebase-admin": "^9.5.0",
nuxt.config.js
workbox: { importScripts: [ // ... "/firebase-auth-sw.js" ], // by default the workbox module will not install the service worker in dev environment to avoid conflicts with HMR // only set this true for testing and remember to always clear your browser cache in development dev: process.env.NODE_ENV === "development" }
auth: { persistence: true, initialize: { onAuthStateChangedAction: "onAuthStateChanged" }, ssr: true, emulatorPort: process.env.NODE_ENV === "development" ? 9099 : undefined, disableEmulatorWarnings: true },
I have do pull request for definitively fix this problem. But I think always isn't better solution for long term.
If you have kid problem : FirebaseAuthError: Firebase ID token has no "kid" claim.
Don't forget to set FIREBASE_AUTH_EMULATOR_HOST
For linux : export FIREBASE_AUTH_EMULATOR_HOST="localhost:9099" && npm run dev
For use this fix before pull merged : edit directly node_modules/@nuxtjs/firebase/lib/sw-templates/firebase-auth-sw.js
template file with my first solution edition.
Is not clean but this work and nuxt not rewrite it
Version
Steps to reproduce
(In this exemple, my Auth emulator is http://localhost:9099)
What is Expected?
But fail because this session not exist on google server So I am disconnected each time the page is refreshed
What is actually happening?
The firebase must to send the request getAccountInfo for valid the session to : http://localhost:9099/www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo
I don't know if this a Nuxt Firebase module bug, a firebase bug or me with a bad configuration. If it's firebase bug, I am sorry for this issue.
But for resolve this bug temporary I have edit the firebase auth service worker and it's work.
I edit : static/firebase-auth-sw.js
But I think It's not the better way for resolve it