import { Alert, AlertType } from "@/components/alert"; import { DynamicTheme } from "@/components/dynamic-theme"; import { RegisterPasskey } from "@/components/register-passkey"; import { UserAvatar } from "@/components/user-avatar"; import { getServiceUrlFromHeaders } from "@/lib/service"; import { loadMostRecentSession } from "@/lib/session"; import { getBrandingSettings } from "@/lib/zitadel"; import { getLocale, getTranslations } from "next-intl/server"; import { headers } from "next/headers"; export default async function Page(props: { searchParams: Promise>; }) { const searchParams = await props.searchParams; const locale = getLocale(); const t = await getTranslations({ locale, namespace: "passkey" }); const tError = await getTranslations({ locale, namespace: "error" }); const { loginName, prompt, organization, authRequestId, userId } = searchParams; const _headers = await headers(); const { serviceUrl, serviceRegion } = getServiceUrlFromHeaders(_headers); const session = await loadMostRecentSession({ serviceUrl, serviceRegion, sessionParams: { loginName, organization, }, }); const branding = await getBrandingSettings({ serviceUrl, serviceRegion, organization, }); return (

{t("set.title")}

{session && ( )}

{t("set.description")}

{t("set.info.description")} {t("set.info.link")} {!session && (
{tError("unknownContext")}
)} {session?.id && ( )}
); }