1
0
Fork 0
mirror of synced 2024-05-17 11:12:41 +12:00

Merge pull request #8008 from appwrite/feat-fix-null-factors-crash

Fix server errors from invalid or outdated cookies
This commit is contained in:
Jake Barnby 2024-04-23 19:51:21 +12:00 committed by GitHub
commit 3769c571fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 && \count($session->getAttribute('factors', [])) < $minimumFactors) {
throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED);
}
}