Skip to content

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

@FelixRe0

Description

@FelixRe0

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 #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 #94 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions