mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 07:53:00 +00:00
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { getBrandingSettings, getLoginSettings, server } from "#/lib/zitadel";
|
|
import DynamicTheme from "#/ui/DynamicTheme";
|
|
import LoginOTP from "#/ui/LoginOTP";
|
|
|
|
export default async function Page({
|
|
searchParams,
|
|
params,
|
|
}: {
|
|
searchParams: Record<string | number | symbol, string | undefined>;
|
|
params: Record<string | number | symbol, string | undefined>;
|
|
}) {
|
|
const { loginName, authRequestId, sessionId, organization, code, submit } =
|
|
searchParams;
|
|
|
|
const { method } = params;
|
|
|
|
const branding = await getBrandingSettings(server, organization);
|
|
|
|
return (
|
|
<DynamicTheme branding={branding}>
|
|
<div className="flex flex-col items-center space-y-4">
|
|
<h1>Verify 2-Factor</h1>
|
|
{method === "time-based" && (
|
|
<p className="ztdl-p">Enter the code from your authenticator app.</p>
|
|
)}
|
|
{method === "sms" && (
|
|
<p className="ztdl-p">Enter the code you got on your phone.</p>
|
|
)}
|
|
{method === "email" && (
|
|
<p className="ztdl-p">Enter the code you got via your email.</p>
|
|
)}
|
|
|
|
{method && (
|
|
<LoginOTP
|
|
loginName={loginName}
|
|
sessionId={sessionId}
|
|
authRequestId={authRequestId}
|
|
organization={organization}
|
|
method={method}
|
|
></LoginOTP>
|
|
)}
|
|
</div>
|
|
</DynamicTheme>
|
|
);
|
|
}
|