From 59ff0643b0d30e8cc3bb5e1236681666537b9959 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 7 Jul 2023 09:28:20 +0200 Subject: [PATCH] Fix auth --- web/service_worker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/service_worker.ts b/web/service_worker.ts index 368da214..0198418d 100644 --- a/web/service_worker.ts +++ b/web/service_worker.ts @@ -97,11 +97,11 @@ self.addEventListener("fetch", (event: any) => { return fetch(request); } - // If this is a /*.* request, this can either be a plug worker load or an attachment load - if (/\/.+\.[a-zA-Z]+$/.test(pathname)) { - return handleLocalFileRequest(request, pathname); - } else if (pathname === "/.auth") { + if (pathname === "/.auth" || pathname === "/index.json") { return fetch(request); + } else if (/\/.+\.[a-zA-Z]+$/.test(pathname)) { + // If this is a /*.* request, this can either be a plug worker load or an attachment load + return handleLocalFileRequest(request, pathname); } else { // Must be a page URL, let's serve index.html which will handle it return (await caches.match(precacheFiles["/"])) || fetch(request);