feat(SW-360): Add signup verification route w. tracking for login
This commit is contained in:
22
components/Blocks/DynamicContent/SignupFormWrapper/index.tsx
Normal file
22
components/Blocks/DynamicContent/SignupFormWrapper/index.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
import { overview } from "@/constants/routes/myPages"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import Form from "@/components/Forms/Register"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import type { RegisterFormProps } from "@/types/components/form/registerForm"
|
||||
|
||||
export default async function SignupFormWrapper({
|
||||
dynamic_content,
|
||||
}: {
|
||||
dynamic_content: RegisterFormProps
|
||||
}) {
|
||||
const session = await auth()
|
||||
if (session) {
|
||||
// We don't want to allow users to signup if they are already authenticated.
|
||||
redirect(overview[getLang()])
|
||||
}
|
||||
return <Form {...dynamic_content} />
|
||||
}
|
||||
Reference in New Issue
Block a user