fix: disable public signup and restore local login flow

This commit is contained in:
2026-04-13 10:06:56 +02:00
parent c4775c623f
commit 9a87ef9562
8 changed files with 70 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
const CACHE_NAME = "putzliga-shell-v1";
const CACHE_NAME = "putzliga-shell-v2";
const ASSETS = [
"/my-tasks",
"/static/css/style.css",
"/static/js/app.js",
"/static/images/logo.svg",
@@ -24,6 +23,24 @@ self.addEventListener("activate", (event) => {
self.addEventListener("fetch", (event) => {
if (event.request.method !== "GET") return;
const url = new URL(event.request.url);
const isStaticAsset =
url.origin === self.location.origin &&
(
url.pathname.startsWith("/static/") ||
url.pathname === "/manifest.json" ||
url.pathname === "/service-worker.js"
);
if (event.request.mode === "navigate") {
event.respondWith(fetch(event.request));
return;
}
if (!isStaticAsset) {
return;
}
event.respondWith(
caches.match(event.request).then((cached) => {
if (cached) return cached;
@@ -32,8 +49,7 @@ self.addEventListener("fetch", (event) => {
const clone = response.clone();
caches.open(CACHE_NAME).then((cache) => cache.put(event.request, clone));
return response;
})
.catch(() => caches.match("/my-tasks"));
});
})
);
});