Files
web/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx
2024-10-24 11:00:47 +02:00

21 lines
618 B
TypeScript

import { redirect } from "next/navigation"
import { overview } from "@/constants/routes/myPages"
import { auth } from "@/auth"
import Form from "@/components/Forms/Signup"
import { getLang } from "@/i18n/serverContext"
import { SignupFormWrapperProps } from "@/types/components/blocks/dynamicContent"
export default async function SignupFormWrapper({
dynamic_content,
}: SignupFormWrapperProps) {
const session = await auth()
if (session) {
// We don't want to allow users to access signup if they are already authenticated.
redirect(overview[getLang()])
}
return <Form {...dynamic_content} />
}