redirect to /set

This commit is contained in:
peintnermax
2024-10-16 16:29:48 +02:00
parent 94bd6bc3f6
commit 69bc1c19e3
10 changed files with 139 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
import { Alert } from "@/components/alert";
import { Alert, AlertType } from "@/components/alert";
import { DynamicTheme } from "@/components/dynamic-theme";
import { SetPasswordForm } from "@/components/set-password-form";
import { UserAvatar } from "@/components/user-avatar";
@@ -37,8 +37,8 @@ export default async function Page({
return (
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">
<h1>{sessionFactors?.factors?.user?.displayName ?? t("title")}</h1>
<p className="ztdl-p mb-6 block">{t("description")}</p>
<h1>{sessionFactors?.factors?.user?.displayName ?? t("set.title")}</h1>
<p className="ztdl-p mb-6 block">{t("set.description")}</p>
{/* show error only if usernames should be shown to be unknown */}
{(!sessionFactors || !loginName) &&
@@ -57,9 +57,14 @@ export default async function Page({
></UserAvatar>
)}
{passwordComplexity && loginName ? (
<Alert type={AlertType.INFO}>{t("set.codeSent")}</Alert>
{passwordComplexity &&
loginName &&
sessionFactors?.factors?.user?.id ? (
<SetPasswordForm
code={code}
userId={sessionFactors.factors.user.id}
loginName={loginName}
authRequestId={authRequestId}
organization={organization}