Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: auto-select single org for CLI SAML login without selector interaction

Igor Correa50c591af48cd
diff --git a/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx b/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx
index 189a6bb9df..9aecf9fd82 100644
--- a/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx
+++ b/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx
@@ -294,8 +294,9 @@ export const SelectOrganizationSection = () => {
if (onlyOneRootOrgWithNoSubOrgs) {
if (callbackPort) {
- handleCliRedirect();
- setIsInitialOrgCheckLoading(false);
+ // CLI flow: auto-select the only org so the token is sent to the CLI
+ // without requiring the user to interact with the selector.
+ handleSelectOrganization(organizations.data[0]);
} else if (!defaultSelectedOrg) {
// No org_id in URL — auto-select the only org directly.
// When defaultSelectedOrg is set, willAutoSelectDefaultOrg handles selection via the second useEffect.