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"), {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,12 @@ import BackgroundImage from "../components/BackgroundImage.astro";
|
||||
<script>
|
||||
import {l} from "../util/util";
|
||||
import {navigate} from "astro:transitions/client";
|
||||
import {loggedIn} from "../components/repo/authv2";
|
||||
import {get} from "svelte/store";
|
||||
|
||||
document.addEventListener("astro:page-load", () => {
|
||||
if (window.location.href.endsWith("/login") || window.location.href.endsWith("/login/")) {
|
||||
if ((localStorage.getItem("sw-session") ?? "") !== "") {
|
||||
if (get(loggedIn)) {
|
||||
navigate(l("/dashboard"), {history: "replace"});
|
||||
}
|
||||
}
|
||||
|
||||
16
src/pages/passwort-zuruecksetzen.astro
Normal file
16
src/pages/passwort-zuruecksetzen.astro
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
import {t} from "astro-i18n";
|
||||
import BackgroundImage from "../components/BackgroundImage.astro";
|
||||
import ResetPasswordComponent from "../components/ResetPasswordComponent.svelte";
|
||||
import NavbarLayout from "../layouts/NavbarLayout.astro";
|
||||
---
|
||||
|
||||
<NavbarLayout title={t("login.page")}>
|
||||
<div class="h-screen w-screen fixed -z-10">
|
||||
<BackgroundImage />
|
||||
</div>
|
||||
<div class="h-screen mx-auto p-8 rounded-b-md pt-40 sm:pt-28 md:pt-14 flex flex-col justify-center items-center
|
||||
dark:text-white " style="width: min(100vw, 75em);">
|
||||
<ResetPasswordComponent client:load/>
|
||||
</div>
|
||||
</NavbarLayout>
|
||||
Reference in New Issue
Block a user