From d7dc58dd23e72b6f244eb1d37ed928ca627cdc32 Mon Sep 17 00:00:00 2001 From: Sam Lewis Date: Tue, 4 Feb 2025 02:54:10 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20Fetch=20PWA=20Manifest=20?= =?UTF-8?q?with=20credentials=20over=20CORS=20(#5156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When behind authentication (for eg: Cloudflare Access), browsers won't send credentials when fetching the manifest file by default. To fix, this change adds `crossorigin="use-credentials"` to the manifest link tag by enabling the `useCredentials` option in VitePWA. --- client/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/vite.config.ts b/client/vite.config.ts index a349e1fbcd..745e4897f6 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -59,6 +59,7 @@ export default defineConfig({ devOptions: { enabled: false, // enable/disable registering SW in development mode }, + useCredentials: true, workbox: { globPatterns: ['assets/**/*.{png,jpg,svg,ico}', '**/*.{js,css,html,ico,woff2}'], maximumFileSizeToCacheInBytes: 4 * 1024 * 1024,