Files
Website/src/pages/dashboard.astro
Chaoscaot 75f1a6528b
All checks were successful
SteamWarCI Build successful
Refactor authentication and implement password reset.
2025-02-17 18:29:17 +01:00

22 lines
794 B
Plaintext

---
import DashboardComponent from "@components/DashboardComponent.svelte";
import PageLayout from "@layouts/PageLayout.astro";
import {t} from "astro-i18n";
---
<PageLayout title={t("dashboard.page")}>
<script>
import {l} from "../util/util";
import {navigate} from "astro:transitions/client";
import {get} from "svelte/store";
import {loggedIn} from "../components/repo/authv2";
document.addEventListener("astro:page-load", () => {
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
if (!get(loggedIn)) {
navigate(l("/login"), {});
}
}
});
</script>
<DashboardComponent client:only="svelte" />
</PageLayout>