From 089af4e137340de666b8eacd1a29d793e168834a Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 23 Apr 2024 16:34:12 +0900 Subject: [PATCH] Update app/controllers/shared/api.php Co-authored-by: Jake Barnby --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 9e2812f631..fdaa98212c 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -290,7 +290,7 @@ App::init() $minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1; if (!in_array('mfa', $route->getGroups())) { - if ($session && !empty($session->getAttribute('factors')) && \count($session->getAttribute('factors')) < $minimumFactors) { + if ($session && \count($session->getAttribute('factors', [])) < $minimumFactors) { throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED); } }