diff --git a/app/Config/Validation/OSPOSRules.php b/app/Config/Validation/OSPOSRules.php index 49be9f367..46437d20d 100644 --- a/app/Config/Validation/OSPOSRules.php +++ b/app/Config/Validation/OSPOSRules.php @@ -39,13 +39,6 @@ class OSPOSRules return false; } - $password = $data['password']; - if (!$employee->login($username, $password)) { - $error = lang('Login.invalid_username_and_password'); - - return false; - } - $gcaptcha_enabled = array_key_exists('gcaptcha_enable', $this->config) && $this->config['gcaptcha_enable']; if ($gcaptcha_enabled) { $g_recaptcha_response = $this->request->getPost('g-recaptcha-response'); @@ -57,6 +50,13 @@ class OSPOSRules } } + $password = $data['password']; + if (!$employee->login($username, $password)) { + $error = lang('Login.invalid_username_and_password'); + + return false; + } + return true; }