Skip to content

EspoCRM – Open Source CRM Application

Do not set app user if 2nd step required

Yurii700cc1318f14
diff --git a/application/Espo/Core/Authentication/Authentication.php b/application/Espo/Core/Authentication/Authentication.php
index 620497c099..3bef797424 100644
--- a/application/Espo/Core/Authentication/Authentication.php
+++ b/application/Espo/Core/Authentication/Authentication.php
@@ -231,7 +231,9 @@ class Authentication
return $this->processFail(Result::fail($anotherUserFailReason), $data, $request);
}
- $this->applicationUser->setUser($loggedUser);
+ if ($result->isSuccess()) {
+ $this->applicationUser->setUser($loggedUser);
+ }
if (
!$result->bypassSecondStep() &&