revert: remove MFA skip for impersonation (not a regression)

This commit is contained in:
harsh mahajan committed 2026-06-25 11:14:03 +05:30
1 parent a7c753e536
commit e8240fa547
1 file changed
+1 -2
+1 -2
View File
@@ -475,8 +475,7 @@ Http::init()
$minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1;
// Step 13: Handle Multi-Factor Authentication
// Skip MFA check when impersonating — the actor already satisfied their own MFA during login.
if (! in_array('mfa', $route->getGroups()) && $impersonatorUser->isEmpty()) {
if (! in_array('mfa', $route->getGroups())) {
if ($session && \count($session->getAttribute('factors', [])) < $minimumFactors) {
throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED);
}