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

const valid = await validateAccessTokenServer(Astro)

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

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


---

<MinimalLayout title="Registrieren - IBCornelsen">
	<RegisterModule client:load redirect={redirect}></RegisterModule>
</MinimalLayout>
