Skip to content

Commit

Permalink
Fix lint issue, add backend permission check for SAML SSO enforcement…
Browse files Browse the repository at this point in the history
… toggle
  • Loading branch information
dangtony98 committed Feb 9, 2024
1 parent ed23bd4 commit 069b0cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backend/src/services/org/org-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 069b0cd

Please sign in to comment.