1
0
Fork 0
mirror of synced 2024-05-18 03:32:45 +12:00

Add Null check before we access factors

This commit is contained in:
Bradley Schofield 2024-04-23 16:24:05 +09:00
parent 2d8694baea
commit 3d17b64eac

View file

@ -290,7 +290,7 @@ App::init()
$minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1;
if (!in_array('mfa', $route->getGroups())) {
if ($session && \count($session->getAttribute('factors')) < $minimumFactors) {
if ($session && !empty($session->getAttribute('factors')) && \count($session->getAttribute('factors')) < $minimumFactors) {
throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED);
}
}