Commit e4a1e858 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

wrong url redirecting to startpage

parent 39e4d650
......@@ -75,11 +75,8 @@ class BrowserVerification
\app()->make(QueryTimer::class)->observeEnd(self::class);
return $next($request);
} else {
# We are serving that request but after solving a captcha
self::logBrowserverification($request);
\app()->make(HumanVerification::class)->lockUser();
\app()->make(QueryTimer::class)->observeEnd(self::class);
return $next($request);
return redirect(url("/"));
}
}
......@@ -177,25 +174,19 @@ class BrowserVerification
public static function logBrowserverification(Request $request)
{
$fail2banEnabled = config("metager.metager.fail2ban.enabled");
if (empty($fail2banEnabled) || !$fail2banEnabled || !config("metager.metager.fail2ban.url") || !config("metager.metager.fail2ban.user") || !config("metager.metager.fail2ban.password")) {
return;
}
$log = [
now()->format("Y-m-d H:i:s"),
$request->input("eingabe"),
"js=" . \app()->make(SearchSettings::class)->javascript_enabled,
"picasso=" . \app()->make(SearchSettings::class)->javascript_picasso,
// Submit fetch job to worker
$mission = [
"resulthash" => "captcha",
"url" => config("metager.metager.fail2ban.url") . "/browserverification/",
"useragent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0",
"username" => config("metager.metager.fail2ban.user"),
"password" => config("metager.metager.fail2ban.password"),
"headers" => [
"ip" => $request->ip()
],
"cacheDuration" => 0,
"name" => "Captcha",
];
$mission = json_encode($mission);
Redis::rpush(\App\MetaGer::FETCHQUEUE_KEY, $mission);
$file_path = \storage_path("logs/metager/bv_fail.csv");
$fh = fopen($file_path, "a");
try {
\fputcsv($fh, $log);
} finally {
fclose($fh);
}
}
}
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