Skip to content

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

improvement: address feedback

Scott Wilsonb113eabeb70b
diff --git a/backend/src/services/org/org-service.ts b/backend/src/services/org/org-service.ts
index f997372315..ffcf4459ee 100644
--- a/backend/src/services/org/org-service.ts
+++ b/backend/src/services/org/org-service.ts
@@ -9,8 +9,10 @@ import {
ProjectMembershipRole,
ProjectVersion,
TableName,
+ TOidcConfigs,
TProjectMemberships,
TProjectUserMembershipRolesInsert,
+ TSamlConfigs,
TUsers
} from "@app/db/schemas";
import { TGroupDALFactory } from "@app/ee/services/group/group-dal";
@@ -449,16 +451,20 @@ export const orgServiceFactory = ({
});
}
- if (authEnforced) {
- const samlCfg = await samlConfigDAL.findOne({
+ let samlCfg: TSamlConfigs | undefined;
+ let oidcCfg: TOidcConfigs | undefined;
+ if (authEnforced || googleSsoAuthEnforced) {
+ samlCfg = await samlConfigDAL.findOne({
orgId,
isActive: true
});
- const oidcCfg = await oidcConfigDAL.findOne({
+ oidcCfg = await oidcConfigDAL.findOne({
orgId,
isActive: true
});
+ }
+ if (authEnforced) {
if (!samlCfg && !oidcCfg)
throw new NotFoundError({
message: `SAML or OIDC configuration for organization with ID '${orgId}' not found`
@@ -486,11 +492,6 @@ export const orgServiceFactory = ({
});
}
- const samlCfg = await samlConfigDAL.findOne({
- orgId,
- isActive: true
- });
-
if (samlCfg) {
throw new BadRequestError({
message:
@@ -498,11 +499,6 @@ export const orgServiceFactory = ({
});
}
- const oidcCfg = await oidcConfigDAL.findOne({
- orgId,
- isActive: true
- });
-
if (oidcCfg) {
throw new BadRequestError({
message: