import { Alert, AlertType } from "@/components/alert"; import { DynamicTheme } from "@/components/dynamic-theme"; import { InviteForm } from "@/components/invite-form"; import { getApiUrlOfHeaders } from "@/lib/service"; import { getBrandingSettings, getDefaultOrg, getLoginSettings, getPasswordComplexitySettings, } 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: "invite" }); let { firstname, lastname, email, organization } = searchParams; const _headers = await headers(); const instanceUrl = getApiUrlOfHeaders(_headers); const host = instanceUrl; if (!host || typeof host !== "string") { throw new Error("No host found"); } if (!organization) { const org = await getDefaultOrg({ host }); if (!org) { throw new Error("No default organization found"); } organization = org.id; } const loginSettings = await getLoginSettings({ host, organization }); const passwordComplexitySettings = await getPasswordComplexitySettings({ host, organization, }); const branding = await getBrandingSettings({ host, organization }); return (

{t("title")}

{t("description")}

{!loginSettings?.allowRegister ? ( {t("notAllowed")} ) : ( {t("info")} )} {passwordComplexitySettings && loginSettings?.allowRegister && ( )}
); }