Dieser Commit ist enthalten in:
Ursprung
c613cef5c4
Commit
77bf19a1c8
@ -9,11 +9,13 @@ import {t} from "astro-i18n";
|
|||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
import {navigate} from "astro:transitions/client";
|
import {navigate} from "astro:transitions/client";
|
||||||
|
|
||||||
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
|
document.addEventListener("astro:page-load", () => {
|
||||||
if ((localStorage.getItem("sw-session") ?? "") === "") {
|
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
|
||||||
navigate(l("/login"), {});
|
if ((localStorage.getItem("sw-session") ?? "") === "") {
|
||||||
|
navigate(l("/login"), {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
<Dashboard client:only="svelte"/>
|
<Dashboard client:only="svelte"/>
|
||||||
</PageLayout>
|
</PageLayout>
|
@ -11,11 +11,13 @@ import localBau from "@images/2023-10-08_20.43.43.png";
|
|||||||
import {l} from "../util/util";
|
import {l} from "../util/util";
|
||||||
import {navigate} from "astro:transitions/client";
|
import {navigate} from "astro:transitions/client";
|
||||||
|
|
||||||
if (window.location.href.endsWith("/login") || window.location.href.endsWith("/login/")) {
|
document.addEventListener("astro:page-load", () => {
|
||||||
if ((localStorage.getItem("sw-session") ?? "") !== "") {
|
if (window.location.href.endsWith("/login") || window.location.href.endsWith("/login/")) {
|
||||||
navigate(l("/dashboard"));
|
if ((localStorage.getItem("sw-session") ?? "") !== "") {
|
||||||
|
navigate(l("/dashboard"), {history: "replace"});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
</script>
|
</script>
|
||||||
<Image src={localBau} alt="Bau" width="1920" height="1080"
|
<Image src={localBau} alt="Bau" width="1920" height="1080"
|
||||||
class="w-screen h-screen dark:brightness-75 fixed -z-10 object-cover" draggable="false"/>
|
class="w-screen h-screen dark:brightness-75 fixed -z-10 object-cover" draggable="false"/>
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren