Merge pull request #8008 from appwrite/feat-fix-null-factors-crash
Fix server errors from invalid or outdated cookies
This commit is contained in:
commit
3769c571fe
|
@ -290,7 +290,7 @@ App::init()
|
||||||
$minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1;
|
$minimumFactors = ($mfaEnabled && $hasMoreFactors) ? 2 : 1;
|
||||||
|
|
||||||
if (!in_array('mfa', $route->getGroups())) {
|
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);
|
throw new Exception(Exception::USER_MORE_FACTORS_REQUIRED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue