Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/thick-rice-heal.md
Original file line number Diff line number Diff line change
@@ -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`.
Comment thread
LauraBeatris marked this conversation as resolved.
Outdated
12 changes: 7 additions & 5 deletions packages/clerk-js/src/ui/components/SignIn/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down
Loading