fix: disable public signup and restore local login flow
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 358 B |
Binary file not shown.
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
@@ -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"));
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user