From c9559142780460308bf7e4864d4700531f77e469 Mon Sep 17 00:00:00 2001
From: peintnermax
Date: Thu, 12 Sep 2024 16:28:15 +0200
Subject: [PATCH] cleanup verify
---
apps/login/src/app/(login)/verify/page.tsx | 28 +++-------------------
apps/login/src/ui/VerifyEmailForm.tsx | 20 ----------------
2 files changed, 3 insertions(+), 45 deletions(-)
diff --git a/apps/login/src/app/(login)/verify/page.tsx b/apps/login/src/app/(login)/verify/page.tsx
index fb9a90b081f..de246e0c5e5 100644
--- a/apps/login/src/app/(login)/verify/page.tsx
+++ b/apps/login/src/app/(login)/verify/page.tsx
@@ -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.
- {(!sessionFactors || !loginName) && (
+ {!userId && (
- 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.
)}
- {sessionFactors && (
-
- )}
-
{userId ? (
) : (
diff --git a/apps/login/src/ui/VerifyEmailForm.tsx b/apps/login/src/ui/VerifyEmailForm.tsx
index d2d130fadc6..ce2589661d9 100644
--- a/apps/login/src/ui/VerifyEmailForm.tsx
+++ b/apps/login/src/ui/VerifyEmailForm.tsx
@@ -23,7 +23,6 @@ type Props = {
authRequestId?: string;
sessionId?: string;
loginSettings?: LoginSettings;
- hasMfaSetUp: boolean;
};
export default function VerifyEmailForm({
@@ -35,7 +34,6 @@ export default function VerifyEmailForm({
authRequestId,
sessionId,
loginSettings,
- hasMfaSetUp,
}: Props) {
const { register, handleSubmit, formState } = useForm({
mode: "onBlur",
@@ -88,24 +86,6 @@ export default function VerifyEmailForm({
return;
}
- if (loginSettings && loginSettings.forceMfa && !hasMfaSetUp) {
- const params = new URLSearchParams({ checkAfter: "true" });
-
- if (loginName) {
- params.set("organization", loginName);
- }
- if (organization) {
- params.set("organization", organization);
- }
-
- if (authRequestId && sessionId) {
- params.set("authRequest", authRequestId);
- params.set("sessionId", sessionId);
- }
-
- return router.push(`/mfa/set?` + params);
- }
-
const params = new URLSearchParams({});
if (organization) {