Skip to content

Commit

Permalink
fix: Fetch manifest with credentials over CORS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samvrlewis committed Jan 24, 2025
1 parent ed57bb4 commit e548fee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e548fee

Please sign in to comment.