Skip to content

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

Fix lint issue, add backend permission check for SAML SSO enforcement toggle

Tuan Dang069b0cd6fbd8
diff --git a/backend/src/services/org/org-service.ts b/backend/src/services/org/org-service.ts
index 8b333316fc..7fafca4387 100644
--- a/backend/src/services/org/org-service.ts
+++ b/backend/src/services/org/org-service.ts
@@ -131,6 +131,10 @@ export const orgServiceFactory = ({
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorOrgId);
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Edit, OrgPermissionSubjects.Settings);
+ if (authEnforced !== undefined) {
+ ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Edit, OrgPermissionSubjects.Sso);
+ }
+
if (authEnforced) {
const samlCfg = await samlConfigDAL.findEnforceableSamlCfg(orgId);
if (!samlCfg)
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx
index 80fd890a17..9bc026cf81 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx
@@ -34,7 +34,6 @@ export const OrgGeneralAuthSection = () => {
await logout.mutateAsync();
window.open(`/api/v1/sso/redirect/saml2/organizations/${currentOrg.slug}`);
window.close();
- return;
}
} catch (err) {