cleanup verify

This commit is contained in:
peintnermax
2024-09-12 16:28:15 +02:00
parent 3d99a686fa
commit c955914278
2 changed files with 3 additions and 45 deletions

View File

@@ -1,8 +1,6 @@
import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings, getLoginSettings } from "@/lib/zitadel";
import Alert from "@/ui/Alert";
import DynamicTheme from "@/ui/DynamicTheme";
import UserAvatar from "@/ui/UserAvatar";
import VerifyEmailForm from "@/ui/VerifyEmailForm";
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
@@ -17,11 +15,6 @@ export default async function Page({ searchParams }: { searchParams: any }) {
authRequestId,
} = searchParams;
const sessionFactors = await loadMostRecentSession({
loginName,
organization,
});
const branding = await getBrandingSettings(organization);
const loginSettings = await getLoginSettings(organization);
@@ -34,24 +27,15 @@ export default async function Page({ searchParams }: { searchParams: any }) {
Enter the Code provided in the verification email.
</p>
{(!sessionFactors || !loginName) && (
{!userId && (
<div className="py-4">
<Alert>
Could not get the context of the user. Make sure to enter the
username first or provide a loginName as searchParam.
Could not get the context of the user. Make sure to provide a
userId as searchParam.
</Alert>
</div>
)}
{sessionFactors && (
<UserAvatar
loginName={loginName ?? sessionFactors.factors?.user?.loginName}
displayName={sessionFactors.factors?.user?.displayName}
showDropdown
searchParams={searchParams}
></UserAvatar>
)}
{userId ? (
<VerifyEmailForm
userId={userId}
@@ -62,12 +46,6 @@ export default async function Page({ searchParams }: { searchParams: any }) {
authRequestId={authRequestId}
sessionId={sessionId}
loginSettings={loginSettings}
hasMfaSetUp={
!!sessionFactors?.factors?.otpEmail?.verifiedAt ||
!!sessionFactors?.factors?.otpSms?.verifiedAt ||
!!sessionFactors?.factors?.totp?.verifiedAt ||
!!sessionFactors?.factors?.webAuthN?.verifiedAt
}
/>
) : (
<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">