mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:57:33 +00:00
check for loginsettings
This commit is contained in:
@@ -75,7 +75,7 @@ export default async function Page(props: {
|
||||
submit={submit}
|
||||
allowRegister={!!loginSettings?.allowRegister}
|
||||
>
|
||||
{identityProviders && (
|
||||
{identityProviders && loginSettings?.allowExternalIdp && (
|
||||
<SignInWithIdp
|
||||
identityProviders={identityProviders}
|
||||
requestId={requestId}
|
||||
|
@@ -12,6 +12,7 @@ import {
|
||||
getPasswordComplexitySettings,
|
||||
} from "@/lib/zitadel";
|
||||
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 { headers } from "next/headers";
|
||||
|
||||
@@ -84,20 +85,24 @@ export default async function Page(props: {
|
||||
|
||||
{!organization && <Alert>{tError("unknownContext")}</Alert>}
|
||||
|
||||
{legal && passwordComplexitySettings && organization && (
|
||||
<RegisterForm
|
||||
idpCount={
|
||||
!loginSettings?.allowExternalIdp ? 0 : identityProviders.length
|
||||
}
|
||||
legal={legal}
|
||||
organization={organization}
|
||||
firstname={firstname}
|
||||
lastname={lastname}
|
||||
email={email}
|
||||
requestId={requestId}
|
||||
loginSettings={loginSettings}
|
||||
></RegisterForm>
|
||||
)}
|
||||
{legal &&
|
||||
passwordComplexitySettings &&
|
||||
organization &&
|
||||
(loginSettings.allowUsernamePassword ||
|
||||
loginSettings.passkeysType == PasskeysType.ALLOWED) && (
|
||||
<RegisterForm
|
||||
idpCount={
|
||||
!loginSettings?.allowExternalIdp ? 0 : identityProviders.length
|
||||
}
|
||||
legal={legal}
|
||||
organization={organization}
|
||||
firstname={firstname}
|
||||
lastname={lastname}
|
||||
email={email}
|
||||
requestId={requestId}
|
||||
loginSettings={loginSettings}
|
||||
></RegisterForm>
|
||||
)}
|
||||
|
||||
{loginSettings?.allowExternalIdp && !!identityProviders.length && (
|
||||
<>
|
||||
|
@@ -185,10 +185,12 @@ export function RegisterForm({
|
||||
</>
|
||||
)}
|
||||
|
||||
{(!loginSettings?.allowUsernamePassword ||
|
||||
loginSettings?.passkeysType != PasskeysType.ALLOWED) &&
|
||||
!idpCount && (
|
||||
<Alert type={AlertType.INFO}>{t("noMethodAvailableWarning")}</Alert>
|
||||
{!loginSettings?.allowUsernamePassword &&
|
||||
loginSettings?.passkeysType != PasskeysType.ALLOWED &&
|
||||
(!loginSettings?.allowExternalIdp || !idpCount) && (
|
||||
<div className="py-4">
|
||||
<Alert type={AlertType.INFO}>{t("noMethodAvailableWarning")}</Alert>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && (
|
||||
|
Reference in New Issue
Block a user