fix(loginV2): hide sign-in-with-idp if none are configured (#10402)

<!--
Please inform yourself about the contribution guidelines on submitting a
PR here:
https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr.
Take note of how PR/commit titles should be written and replace the
template texts in the sections below. Don't remove any of the sections.
It is important that the commit history clearly shows what is changed
and why.
Important: By submitting a contribution you agree to the terms from our
Licensing Policy as described here:
https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions.
-->

# Which Problems Are Solved

Don't show the external IdP section, if none are configured.

# How the Problems Are Solved

- Checks if the length of `identityProviders` is non-empty.

# Additional Changes

- Added 2 additional null-checks for `identityProviders`

# Additional Context

- Closes #10401

Co-authored-by: Max Peintner <max@caos.ch>
Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Jonas Badstübner
2025-08-15 14:00:16 +02:00
committed by GitHub
parent 0929c4d235
commit a718267191
3 changed files with 3 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ export default async function Page(props: {
<Translated i18nKey="description" namespace="idp" />
</p>
{identityProviders && (
{!!identityProviders?.length && (
<SignInWithIdp
identityProviders={identityProviders}
requestId={requestId}

View File

@@ -78,7 +78,7 @@ export default async function Page(props: {
allowRegister={!!loginSettings?.allowRegister}
></UsernameForm>
{identityProviders && loginSettings?.allowExternalIdp && (
{loginSettings?.allowExternalIdp && !!identityProviders?.length && (
<div className="w-full pb-4 pt-6">
<SignInWithIdp
identityProviders={identityProviders}

View File

@@ -80,7 +80,7 @@ export function SignInWithIdp({
<p className="ztdl-p text-center">
<Translated i18nKey="orSignInWith" namespace="idp" />
</p>
{!!identityProviders.length && identityProviders?.map(renderIDPButton)}
{!!identityProviders?.length && identityProviders?.map(renderIDPButton)}
{state?.error && (
<div className="py-4">
<Alert>{state?.error}</Alert>