Files
zitadel/apps/login/app/(login)/register/page.tsx
Max Peintner 22bf028fd1 test register
2023-07-04 14:52:33 +02:00

52 lines
1.5 KiB
TypeScript

import {
getLegalAndSupportSettings,
getPasswordComplexitySettings,
server,
} from "#/lib/zitadel";
import RegisterFormWithoutPassword from "#/ui/RegisterFormWithoutPassword";
import SetPasswordForm from "#/ui/SetPasswordForm";
export default async function Page({
searchParams,
}: {
searchParams: Record<string | number | symbol, string | undefined>;
}) {
const { firstname, lastname, email } = searchParams;
const setPassword = !!(firstname && lastname && email);
const legal = await getLegalAndSupportSettings(server);
console.log("legal", legal);
const passwordComplexitySettings = await getPasswordComplexitySettings(
server
);
console.log("complexity", passwordComplexitySettings);
return setPassword ? (
<div className="flex flex-col items-center space-y-4">
<h1>Set Password</h1>
<p className="ztdl-p">Set the password for your account</p>
{legal && passwordComplexitySettings && (
<SetPasswordForm
passwordComplexitySettings={passwordComplexitySettings}
email={email}
firstname={firstname}
lastname={lastname}
></SetPasswordForm>
)}
</div>
) : (
<div className="flex flex-col items-center space-y-4">
<h1>Register</h1>
<p className="ztdl-p">Create your ZITADEL account.</p>
{legal && passwordComplexitySettings && (
<RegisterFormWithoutPassword
legal={legal}
></RegisterFormWithoutPassword>
)}
</div>
);
}