feat(modal): refactor modal types and integrate security action requirements

This commit is contained in:
2026-04-24 08:52:22 -04:00
parent 38dd017dcd
commit f82d314d80
7 changed files with 207 additions and 80 deletions
-7
View File
@@ -9,10 +9,3 @@ export function parseTotpEnabled(tokenValue: string | null) {
return false;
}
}
export function needsAdminTotp(totpEnabled: boolean, currentRoles: number, nextRoles: number) {
if (!totpEnabled) return false;
const nextHasAdmin = (nextRoles & 4) !== 0;
const alreadyAdmin = (currentRoles & 4) !== 0;
return nextHasAdmin && !alreadyAdmin;
}