Dieser Commit ist enthalten in:
Ursprung
91978ce03c
Commit
7cf76bc7c7
@ -5,14 +5,16 @@ import {t} from "astro-i18n";
|
|||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout title={t("dashboard.page")}>
|
<PageLayout title={t("dashboard.page")}>
|
||||||
<script is:inline data-astro-rerun type="module">
|
<script>
|
||||||
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>
|
@ -7,15 +7,17 @@ import localBau from "@images/2023-10-08_20.43.43.png";
|
|||||||
---
|
---
|
||||||
|
|
||||||
<NavbarLayout title={t("login.page")}>
|
<NavbarLayout title={t("login.page")}>
|
||||||
<script is:inline data-astro-rerun type="module">
|
<script>
|
||||||
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"), {history: "replace"});
|
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