Files

51 lines
1.4 KiB
TypeScript

export const dynamic = "force-dynamic";
const html = String.raw`<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HiveGrid wird bereinigt</title>
</head>
<body>
<script>
(async () => {
try {
if ("serviceWorker" in navigator) {
const registrations = await navigator.serviceWorker.getRegistrations();
await Promise.all(registrations.map((registration) => registration.unregister()));
}
if ("caches" in window) {
const keys = await caches.keys();
await Promise.all(keys.map((key) => caches.delete(key)));
}
try {
localStorage.clear();
sessionStorage.clear();
} catch {}
document.cookie.split(";").forEach((cookie) => {
const name = cookie.split("=")[0]?.trim();
if (name) {
document.cookie = name + "=; Max-Age=0; path=/; SameSite=Lax";
}
});
} finally {
window.location.replace("/");
}
})();
</script>
</body>
</html>`;
export function GET() {
return new Response(html, {
headers: {
"Content-Type": "text/html; charset=utf-8",
"Cache-Control": "no-cache, no-store, must-revalidate",
},
});
}