---
import PasswortVergessenModule from "../../modules/Auth/PasswortVergessenModule.svelte";
import { validateAccessTokenServer } from "src/server/lib/validateAccessToken";
import MinimalLayout from "#layouts/MinimalLayout.astro";

const valid = await validateAccessTokenServer(Astro)

if (valid) {
	return Astro.redirect("/dashboard")
}

const redirect = Astro.url.searchParams.get("redirect")
---

<MinimalLayout title="Passwort Vergessen">
	<PasswortVergessenModule client:load redirect={redirect}></PasswortVergessenModule>
</MinimalLayout>
