2024-04-01 13:57:39 +02:00
|
|
|
import { getBrandingSettings, server } from "#/lib/zitadel";
|
|
|
|
|
import DynamicTheme from "#/ui/DynamicTheme";
|
2023-05-17 17:04:56 +02:00
|
|
|
import VerifyEmailForm from "#/ui/VerifyEmailForm";
|
|
|
|
|
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
|
|
|
|
|
|
|
|
|
export default async function Page({ searchParams }: { searchParams: any }) {
|
2024-04-01 14:27:15 +02:00
|
|
|
const {
|
2024-04-01 15:03:41 +02:00
|
|
|
userId,
|
|
|
|
|
sessionId,
|
2024-04-01 14:27:15 +02:00
|
|
|
code,
|
|
|
|
|
submit,
|
|
|
|
|
organization,
|
|
|
|
|
authRequestId,
|
|
|
|
|
loginname,
|
|
|
|
|
passwordset,
|
|
|
|
|
} = searchParams;
|
2024-04-01 13:57:39 +02:00
|
|
|
|
|
|
|
|
const branding = await getBrandingSettings(server, organization);
|
2023-05-17 17:04:56 +02:00
|
|
|
|
|
|
|
|
return (
|
2024-04-01 13:57:39 +02:00
|
|
|
<DynamicTheme branding={branding}>
|
|
|
|
|
<div className="flex flex-col items-center space-y-4">
|
|
|
|
|
<h1>Verify user</h1>
|
|
|
|
|
<p className="ztdl-p mb-6 block">
|
|
|
|
|
Enter the Code provided in the verification email.
|
|
|
|
|
</p>
|
2023-05-17 17:04:56 +02:00
|
|
|
|
2024-04-01 15:26:47 +02:00
|
|
|
{userId ? (
|
2024-04-01 13:57:39 +02:00
|
|
|
<VerifyEmailForm
|
2024-04-01 15:26:47 +02:00
|
|
|
userId={userId}
|
2024-04-01 13:57:39 +02:00
|
|
|
code={code}
|
|
|
|
|
submit={submit === "true"}
|
|
|
|
|
organization={organization}
|
2024-04-01 14:27:15 +02:00
|
|
|
authRequestId={authRequestId}
|
2024-04-01 15:03:41 +02:00
|
|
|
sessionId={sessionId}
|
2024-04-01 13:57:39 +02:00
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="w-full flex flex-row items-center justify-center border border-yellow-600/40 dark:border-yellow-500/20 bg-yellow-200/30 text-yellow-600 dark:bg-yellow-700/20 dark:text-yellow-200 rounded-md py-2 scroll-px-40">
|
|
|
|
|
<ExclamationTriangleIcon className="h-5 w-5 mr-2" />
|
|
|
|
|
<span className="text-center text-sm">No userId provided!</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</DynamicTheme>
|
2023-05-17 17:04:56 +02:00
|
|
|
);
|
|
|
|
|
}
|