Allow errors set from hook actionBeforeAuthentication prevent customer login

This commit is contained in:
Abhishek Kumar
2023-08-24 19:00:58 +05:30
parent ccace94c38
commit ee6fce84bb

View File

@@ -294,7 +294,9 @@ class AuthControllerCore extends FrontController
$this->errors[] = Tools::displayError('Password is required.');
} elseif (!Validate::isPasswd($passwd)) {
$this->errors[] = Tools::displayError('Invalid password.');
} else {
}
if (!count($this->errors)) {
$customer = new Customer();
$authentication = $customer->getByEmail(trim($email), trim($passwd));
if (isset($authentication->active) && !$authentication->active) {
@@ -321,6 +323,7 @@ class AuthControllerCore extends FrontController
}
}
}
if ($this->ajax) {
$return = array(
'hasError' => !empty($this->errors),