check for loginsettings

This commit is contained in:
Max Peintner
2025-06-11 14:02:13 +02:00
parent 75d2186490
commit 4e6ff833d8
3 changed files with 26 additions and 19 deletions

View File

@@ -75,7 +75,7 @@ export default async function Page(props: {
submit={submit} submit={submit}
allowRegister={!!loginSettings?.allowRegister} allowRegister={!!loginSettings?.allowRegister}
> >
{identityProviders && ( {identityProviders && loginSettings?.allowExternalIdp && (
<SignInWithIdp <SignInWithIdp
identityProviders={identityProviders} identityProviders={identityProviders}
requestId={requestId} requestId={requestId}

View File

@@ -12,6 +12,7 @@ import {
getPasswordComplexitySettings, getPasswordComplexitySettings,
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb"; import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { PasskeysType } from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
import { getLocale, getTranslations } from "next-intl/server"; import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
@@ -84,7 +85,11 @@ export default async function Page(props: {
{!organization && <Alert>{tError("unknownContext")}</Alert>} {!organization && <Alert>{tError("unknownContext")}</Alert>}
{legal && passwordComplexitySettings && organization && ( {legal &&
passwordComplexitySettings &&
organization &&
(loginSettings.allowUsernamePassword ||
loginSettings.passkeysType == PasskeysType.ALLOWED) && (
<RegisterForm <RegisterForm
idpCount={ idpCount={
!loginSettings?.allowExternalIdp ? 0 : identityProviders.length !loginSettings?.allowExternalIdp ? 0 : identityProviders.length

View File

@@ -185,10 +185,12 @@ export function RegisterForm({
</> </>
)} )}
{(!loginSettings?.allowUsernamePassword || {!loginSettings?.allowUsernamePassword &&
loginSettings?.passkeysType != PasskeysType.ALLOWED) && loginSettings?.passkeysType != PasskeysType.ALLOWED &&
!idpCount && ( (!loginSettings?.allowExternalIdp || !idpCount) && (
<div className="py-4">
<Alert type={AlertType.INFO}>{t("noMethodAvailableWarning")}</Alert> <Alert type={AlertType.INFO}>{t("noMethodAvailableWarning")}</Alert>
</div>
)} )}
{error && ( {error && (