Refactor authentication and implement password reset.
All checks were successful
SteamWarCI Build successful
All checks were successful
SteamWarCI Build successful
This commit is contained in:
@@ -8,9 +8,11 @@ import {t} from "astro-i18n";
|
||||
<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 ((localStorage.getItem("sw-session") ?? "") === "") {
|
||||
if (!get(loggedIn)) {
|
||||
navigate(l("/login"), {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user