diff --git a/apps/login/locales/de.json b/apps/login/locales/de.json index 4314e65119f..48e7c7f643b 100644 --- a/apps/login/locales/de.json +++ b/apps/login/locales/de.json @@ -156,6 +156,7 @@ "verify": { "userIdMissing": "Keine Benutzer-ID angegeben!", "success": "Erfolgreich verifiziert", + "setupAuthenticator": "Authentifikator einrichten", "verify": { "title": "Benutzer verifizieren", "description": "Geben Sie den Code ein, der in der Bestätigungs-E-Mail angegeben ist.", diff --git a/apps/login/locales/en.json b/apps/login/locales/en.json index 7b1411488f6..e709b553be4 100644 --- a/apps/login/locales/en.json +++ b/apps/login/locales/en.json @@ -156,6 +156,7 @@ "verify": { "userIdMissing": "No userId provided!", "success": "The user has been verified successfully.", + "setupAuthenticator": "Setup authenticator", "verify": { "title": "Verify user", "description": "Enter the Code provided in the verification email.", diff --git a/apps/login/locales/es.json b/apps/login/locales/es.json index ee894d732bc..e9a8e1b5ab2 100644 --- a/apps/login/locales/es.json +++ b/apps/login/locales/es.json @@ -156,6 +156,7 @@ "verify": { "userIdMissing": "¡No se proporcionó userId!", "success": "¡Verificación exitosa!", + "setupAuthenticator": "Configurar autenticador", "verify": { "title": "Verificar usuario", "description": "Introduce el código proporcionado en el correo electrónico de verificación.", diff --git a/apps/login/locales/it.json b/apps/login/locales/it.json index a81f8f7c16d..b5ff7a48e50 100644 --- a/apps/login/locales/it.json +++ b/apps/login/locales/it.json @@ -156,6 +156,7 @@ "verify": { "userIdMissing": "Nessun userId fornito!", "success": "Verifica effettuata con successo!", + "setupAuthenticator": "Configura autenticatore", "verify": { "title": "Verifica utente", "description": "Inserisci il codice fornito nell'email di verifica.", diff --git a/apps/login/src/app/(login)/authenticator/set/page.tsx b/apps/login/src/app/(login)/authenticator/set/page.tsx index db1686dd303..78a06ab3296 100644 --- a/apps/login/src/app/(login)/authenticator/set/page.tsx +++ b/apps/login/src/app/(login)/authenticator/set/page.tsx @@ -120,7 +120,6 @@ export default async function Page({ {loginSettings && sessionWithData && ( diff --git a/apps/login/src/app/(login)/verify/page.tsx b/apps/login/src/app/(login)/verify/page.tsx index 368e9c1c5cd..030e7af6082 100644 --- a/apps/login/src/app/(login)/verify/page.tsx +++ b/apps/login/src/app/(login)/verify/page.tsx @@ -1,10 +1,18 @@ import { Alert, AlertType } from "@/components/alert"; +import { BackButton } from "@/components/back-button"; +import { Button, ButtonVariants } from "@/components/button"; import { DynamicTheme } from "@/components/dynamic-theme"; import { UserAvatar } from "@/components/user-avatar"; import { VerifyForm } from "@/components/verify-form"; -import { getBrandingSettings, getUserByID } from "@/lib/zitadel"; +import { + getBrandingSettings, + getUserByID, + listAuthenticationMethodTypes, +} from "@/lib/zitadel"; import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb"; +import { AuthenticationMethodType } from "@zitadel/proto/zitadel/user/v2/user_service_pb"; import { getLocale, getTranslations } from "next-intl/server"; +import Link from "next/link"; export default async function Page({ searchParams }: { searchParams: any }) { const locale = getLocale(); @@ -28,6 +36,14 @@ export default async function Page({ searchParams }: { searchParams: any }) { } } + let authMethods: AuthenticationMethodType[] | null = null; + if (human?.email?.isVerified) { + const authMethodsResponse = await listAuthenticationMethodTypes(userId); + if (authMethodsResponse.authMethodTypes) { + authMethods = authMethodsResponse.authMethodTypes; + } + } + const params = new URLSearchParams({ userId: userId, initial: "true", // defines that a code is not required and is therefore not shown in the UI @@ -70,7 +86,25 @@ export default async function Page({ searchParams }: { searchParams: any }) { /> )} {human?.email?.isVerified ? ( - {t("success")} + <> + {t("success")} + +
+ + + {authMethods?.length !== 0 && ( + + + + )} +
+ ) : ( // check if auth methods are set