Update middleware to allow access of serviceworker files

This commit is contained in:
JuliusMoehring 2023-11-08 13:18:27 +01:00
parent 4628980974
commit d8b38b6171

View File

@ -1,5 +1,19 @@
export { default } from "next-auth/middleware";
export const config = {
matcher: ["/((?!login).*)"],
matcher: [
/*
* Match all request paths except for the ones starting with:
* - login (login route)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
* - prompts.json (prompts file)
* - redirect.json (redirect file)
* - serviceWorker.js (service worker file)
* - serviceWorkerRegister.js (service worker register file)
* - site.webmanifest (manifest file)
*/
"/((?!api|_next/static|_next/image|favicon.ico|prompts.json|redirect.json|serviceWorker.js|serviceWorkerRegister.js|site.webmanifest).*)",
],
};