mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 18:26:42 +00:00
improvement: address feedback
This commit is contained in:
@@ -9,8 +9,10 @@ import {
|
|||||||
ProjectMembershipRole,
|
ProjectMembershipRole,
|
||||||
ProjectVersion,
|
ProjectVersion,
|
||||||
TableName,
|
TableName,
|
||||||
|
TOidcConfigs,
|
||||||
TProjectMemberships,
|
TProjectMemberships,
|
||||||
TProjectUserMembershipRolesInsert,
|
TProjectUserMembershipRolesInsert,
|
||||||
|
TSamlConfigs,
|
||||||
TUsers
|
TUsers
|
||||||
} from "@app/db/schemas";
|
} from "@app/db/schemas";
|
||||||
import { TGroupDALFactory } from "@app/ee/services/group/group-dal";
|
import { TGroupDALFactory } from "@app/ee/services/group/group-dal";
|
||||||
@@ -449,16 +451,20 @@ export const orgServiceFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authEnforced) {
|
let samlCfg: TSamlConfigs | undefined;
|
||||||
const samlCfg = await samlConfigDAL.findOne({
|
let oidcCfg: TOidcConfigs | undefined;
|
||||||
|
if (authEnforced || googleSsoAuthEnforced) {
|
||||||
|
samlCfg = await samlConfigDAL.findOne({
|
||||||
orgId,
|
orgId,
|
||||||
isActive: true
|
isActive: true
|
||||||
});
|
});
|
||||||
const oidcCfg = await oidcConfigDAL.findOne({
|
oidcCfg = await oidcConfigDAL.findOne({
|
||||||
orgId,
|
orgId,
|
||||||
isActive: true
|
isActive: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authEnforced) {
|
||||||
if (!samlCfg && !oidcCfg)
|
if (!samlCfg && !oidcCfg)
|
||||||
throw new NotFoundError({
|
throw new NotFoundError({
|
||||||
message: `SAML or OIDC configuration for organization with ID '${orgId}' not found`
|
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) {
|
if (samlCfg) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message:
|
message:
|
||||||
@@ -498,11 +499,6 @@ export const orgServiceFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const oidcCfg = await oidcConfigDAL.findOne({
|
|
||||||
orgId,
|
|
||||||
isActive: true
|
|
||||||
});
|
|
||||||
|
|
||||||
if (oidcCfg) {
|
if (oidcCfg) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message:
|
message:
|
||||||
|
|||||||
Reference in New Issue
Block a user