improvement: address feedback

This commit is contained in:
Scott Wilson
2025-09-10 14:48:33 -07:00
parent a677191e47
commit d5da5161c8
6 changed files with 26 additions and 26 deletions
@@ -1,6 +1,7 @@
import { ForbiddenError } from "@casl/ability";
import { OrgMembershipStatus, TableName, TSamlConfigs, TSamlConfigsUpdate, TUsers } from "@app/db/schemas";
import { throwOnPlanSeatLimitReached } from "@app/ee/services/license/license-fns";
import { getConfig } from "@app/lib/config/env";
import { crypto } from "@app/lib/crypto";
import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
@@ -383,14 +384,7 @@ export const samlConfigServiceFactory = ({
);
if (!orgMembership) {
const plan = await licenseService.getPlan(orgId);
if (plan?.slug !== "enterprise" && plan?.identityLimit && plan.identitiesUsed >= plan.identityLimit) {
// limit imposed on number of identities allowed / number of identities used exceeds the number of identities allowed
throw new BadRequestError({
message:
"Failed to create new member via SAML due to member limit reached. Upgrade plan to add more members."
});
}
await throwOnPlanSeatLimitReached(licenseService, orgId, UserAliasType.SAML);
const { role, roleId } = await getDefaultOrgMembershipRole(organization.defaultMembershipRole);