-
-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Version
"nuxt": "^2.15.1",
"firebase": "^8.2.8",
"@nuxtjs/proxy": "^2.1.0",
"@nuxtjs/pwa": "^3.3.5",
"@nuxtjs/firebase": "^7.5.0",
"core-js": "^3.9.0",
Steps to reproduce
- Use Firestore auth with emulator
- Connect user
- Refresh the page (F5 or CTRL + R)
(In this exemple, my Auth emulator is http://localhost:9099)
What is Expected?
- On the first login, the firebase call the good link :
http://localhost:9099/www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo?key=xxxxxxxxxx
The request receive good response - On page refresh, the firebase module send the getAccountInfo request to googleapis.com directly :
https://www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo?key=xxxxxxxxxxxx
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
if (!expectsHTML || !isSameOrigin || !isHttps || isIgnored) {
+ if (event.request.url.startsWith('https://www.googleapis.com/identitytoolkit/')) {
+ event.respondWith(
+ fetch({
+ ...event.request,
+ ...{ url: event.request.url.replace(/https:\/\//, 'http://localhost:9099/') },
+ })
+ )
+ } else event.respondWith(fetch(event.request))
- event.respondWith(fetch(event.request))
return
}
But I think It's not the better way for resolve it
prakashchokalingam, lupas, VikingTristan, johngtb, polymer-coder and 2 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working