Skip to content

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

fix: check sub before discarding current config

Scott Wilson1541ed0d6671
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/OrgSsoTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/OrgSsoTab.tsx
index ebad4aeaa0..5c2819cd90 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/OrgSsoTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgSsoTab/OrgSsoTab.tsx
@@ -216,6 +216,12 @@ export const OrgSsoTab = withPermission(
else if (provider === "ldap") handleConnectLdap();
};
+ const isProviderEntitled = (provider: "saml" | "oidc" | "ldap") => {
+ if (provider === "saml") return Boolean(subscription?.samlSSO);
+ if (provider === "oidc") return Boolean(subscription?.oidcSSO);
+ return Boolean(subscription?.ldap);
+ };
+
const handleConnectSelected = () => {
if (!selectedProvider) return;
const exclude = chooserExclude;
@@ -223,6 +229,10 @@ export const OrgSsoTab = withPermission(
closeChooser();
if (exclude && (target === "saml" || target === "oidc" || target === "ldap")) {
+ if (!isProviderEntitled(target)) {
+ openSelectedProvider(target);
+ return;
+ }
setPendingSwitch({ from: exclude, to: target });
return;
}
@@ -240,6 +250,12 @@ export const OrgSsoTab = withPermission(
if (!pendingSwitch || !currentOrg) return;
const { from, to } = pendingSwitch;
+ if (!isProviderEntitled(to)) {
+ setPendingSwitch(null);
+ openSelectedProvider(to);
+ return;
+ }
+
if (from === "saml") {
await updateSamlAsync({
organizationId: currentOrg.id,