From cba4c31626d8c179cf9f8694ae2418c3a432952a Mon Sep 17 00:00:00 2001 From: Nicolas Lopes Date: Mon, 13 Oct 2025 17:22:26 -0300 Subject: [PATCH 1/2] fix(clerk-js): Only show enterprise accounts chooser with multiple connections Fix logic to only display enterprise accounts chooser when there are multiple enterprise connections available as supported first factors, instead of showing it for every enterprise SSO sign-in. --- .changeset/thick-rice-heal.md | 8 ++++++++ packages/clerk-js/src/ui/components/SignIn/shared.ts | 12 +++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .changeset/thick-rice-heal.md diff --git a/.changeset/thick-rice-heal.md b/.changeset/thick-rice-heal.md new file mode 100644 index 00000000000..21b272307ce --- /dev/null +++ b/.changeset/thick-rice-heal.md @@ -0,0 +1,8 @@ +--- +'@clerk/clerk-js': patch +--- + +Only go to enterprise connections chooser when there are multiple orgs +Before every sign-in with `enterprise_sso` strategy was going through +the enterprise accounts chooser, we only want to show it when there +are multiple enterprise connections available as `supported_first_factors`. diff --git a/packages/clerk-js/src/ui/components/SignIn/shared.ts b/packages/clerk-js/src/ui/components/SignIn/shared.ts index 41a5828d9b5..cb9fdde7d6b 100644 --- a/packages/clerk-js/src/ui/components/SignIn/shared.ts +++ b/packages/clerk-js/src/ui/components/SignIn/shared.ts @@ -77,11 +77,13 @@ function hasMultipleEnterpriseConnections( return false; } - return factors.every( - factor => - factor.strategy === 'enterprise_sso' && - 'enterpriseConnectionId' in factor && - 'enterpriseConnectionName' in factor, + return ( + factors.filter( + factor => + factor.strategy === 'enterprise_sso' && + 'enterpriseConnectionId' in factor && + 'enterpriseConnectionName' in factor, + ).length > 1 ); } From 967f7225825ea32f230f88786e537803b868687e Mon Sep 17 00:00:00 2001 From: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com> Date: Tue, 14 Oct 2025 06:15:20 -0700 Subject: [PATCH 2/2] Update .changeset/thick-rice-heal.md --- .changeset/thick-rice-heal.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.changeset/thick-rice-heal.md b/.changeset/thick-rice-heal.md index 21b272307ce..2dc261a087d 100644 --- a/.changeset/thick-rice-heal.md +++ b/.changeset/thick-rice-heal.md @@ -2,7 +2,4 @@ '@clerk/clerk-js': patch --- -Only go to enterprise connections chooser when there are multiple orgs -Before every sign-in with `enterprise_sso` strategy was going through -the enterprise accounts chooser, we only want to show it when there -are multiple enterprise connections available as `supported_first_factors`. +Only navigate to enterprise connections chooser when there are multiple `enterprise_sso` strategies as `supported_first_factors`