misc: made bypass opt-in

This commit is contained in:
Sheen Capadngan
2025-04-16 23:58:20 +08:00
parent dd0880825b
commit 76c3f1c152
14 changed files with 180 additions and 73 deletions
@@ -69,7 +69,10 @@ export const SelectOrganizationPage = () => {
const handleSelectOrganization = useCallback(
async (organization: Organization) => {
if (organization.authEnforced && organization.userRole !== OrgMembershipRole.Admin) {
const canBypassOrgAuth =
organization.enableBypassOrgAuth && organization.userRole === OrgMembershipRole.Admin;
if (organization.authEnforced && !canBypassOrgAuth) {
// org has an org-level auth method enabled (e.g. SAML)
// -> logout + redirect to SAML SSO
await logout.mutateAsync();