Skip to content

Commit

Permalink
Fix login captcha error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightprince committed Dec 14, 2023
1 parent 0945277 commit 512d7b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions application/modules/auth/controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,18 @@ public function checkLogin()
{
$data['showCaptcha'] = true;
if ($captcha_type == 'inbuilt') {
if ($this->input->post('captcha') != $this->captcha->getValue() || empty($this->input->post('captcha')))
if ($this->input->post('captcha') != $this->captcha->getValue() || empty($this->input->post('captcha'))) {
$data['messages']["error"] = lang("captcha_invalid", "auth");
die(json_encode($data));
}
} else if ($captcha_type == 'recaptcha') {
$recaptcha = $this->input->post('recaptcha');
$result = $this->recaptcha->verifyResponse($recaptcha)['success'];
if (!$result)
if (!$result) {
$data['messages']["error"] = lang("captcha_invalid", "auth") . $result;
die(json_encode($data));
}
}
die(json_encode($data));
}

//Login
Expand Down

0 comments on commit 512d7b7

Please sign in to comment.