Refactor: Implement AAL2 enforcement fix

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 19:25:51 +00:00
parent 0eac7f3d7d
commit 5292045e7a
2 changed files with 7 additions and 2 deletions

View File

@@ -34,11 +34,15 @@ export function useRequireMFA() {
// User has MFA if they have AAL2 AND have enrolled factors
const hasMFA = aal === 'aal2' && isEnrolled;
// User needs to verify MFA if they're enrolled but session is still at AAL1
const needsVerification = requiresMFA && isEnrolled && aal === 'aal1';
return {
requiresMFA,
hasMFA,
isEnrolled,
needsEnrollment: requiresMFA && !isEnrolled,
needsVerification,
aal,
loading: loading || roleLoading,
};