Commit 47c3ab55 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed captcha

parent cc6bddc6
...@@ -47,10 +47,11 @@ class HumanVerification extends Controller ...@@ -47,10 +47,11 @@ class HumanVerification extends Controller
if ($request->getMethod() == 'POST') { if ($request->getMethod() == 'POST') {
\App\PrometheusExporter::CaptchaAnswered(); \App\PrometheusExporter::CaptchaAnswered();
$lockedKey = $user["lockedKey"]; $lockedKey = $user["lockedKey"];
$key = $request->input('captcha');
$key = strtolower($key);
if (!$hasher->check($key, $lockedKey)) { $rules = ['captcha' => 'required|captcha_api:' . $lockedKey . ',math'];
$validator = validator()->make(request()->all(), $rules);
if($validator->fails()) {
$captcha = Captcha::create("default", true); $captcha = Captcha::create("default", true);
$user["lockedKey"] = $captcha["key"]; $user["lockedKey"] = $captcha["key"];
HumanVerification::saveUser($user); HumanVerification::saveUser($user);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment