nuxt-community / pwa-module

Zero config PWA solution for Nuxt.js
https://pwa.nuxtjs.org
MIT License
1.23k stars 171 forks source link

Basic Auth won't prompt for credentials due to service worker caching response #278

Open FelixRe0 opened 4 years ago

FelixRe0 commented 4 years ago

Even with the proposed fix https://pwa.nuxtjs.org/modules/workbox.html#basic-auth I am experiencing the issue. Crossorigin is set correctly in index.html. <link data-n-head="1" rel="manifest" href="/_nuxt/manifest.c09e73a7.json" crossorigin="use-credentials">

Registering the routes causes the issue:

workbox.routing.registerRoute(new RegExp('/'), new workbox.strategies.NetworkFirst (), 'GET')

When setting offline: false to remove them the login prompt appears as intended. Therefore, I believe the issue is different from https://github.com/nuxt-community/pwa-module/issues/94

The request workbox sent (from debug mode):

method: "GET"
url: "https://****.***/"
headers: Headers {}
destination: "document"
referrer: ""
referrerPolicy: "no-referrer-when-downgrade"
mode: "navigate"
credentials: "include"
cache: "default"
redirect: "manual"
integrity: ""
keepalive: false
signal: AbortSignal {aborted: false, onabort: null}
isHistoryNavigation: false
bodyUsed: false

Am I missing anything?

I'm on "@nuxtjs/pwa": "^3.0.0-beta.20" Chrome v. 80.0.3987.149

Originally posted by @FelixRe0 in https://github.com/nuxt-community/pwa-module/issues/94#issuecomment-601084532

bestii commented 2 months ago

Any update on this issue?