Skip to content
Snippets Groups Projects
Commit 9499ee77 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

disable bv skipping

parent e98fe98b
No related branches found
No related tags found
No related merge requests found
......@@ -8,14 +8,12 @@ use Jenssegers\Agent\Agent;
use Illuminate\Http\Request;
use App\QueryTimer;
use Cache;
use App\MetaGer;
use App\Models\HumanVerification;
use App\SearchSettings;
class BrowserVerification
{
private ?string $verification_key = null;
/**
* Handle an incoming request.
*
......@@ -29,11 +27,6 @@ class BrowserVerification
$this->verification_key = \hash("sha512", $request->ip() . $_SERVER["AGENT"]);
if (Cache::has($this->verification_key) && Cache::get($this->verification_key) === true) {
\app()->make(QueryTimer::class)->observeEnd(self::class);
return $next($request);
}
$bvEnabled = config("metager.metager.browserverification_enabled");
if (empty($bvEnabled) || !$bvEnabled) {
\app()->make(QueryTimer::class)->observeEnd(self::class);
......@@ -83,8 +76,6 @@ class BrowserVerification
$search_settings->jskey = $mgv;
$search_settings->header_printed = false;
\app()->make(QueryTimer::class)->observeEnd(self::class);
// Prevent another Browserverification for this user
Cache::put($this->verification_key, true, now()->addDay());
return $next($request);
} else {
# We are serving that request but after solving a captcha
......@@ -107,8 +98,6 @@ class BrowserVerification
$search_settings = \app()->make(SearchSettings::class);
$search_settings->jskey = $key;
$search_settings->header_printed = true;
// Prevent another Browserverification for this user
Cache::put($this->verification_key, true, now()->addDay());
\app()->make(QueryTimer::class)->observeEnd(self::class);
return $next($request);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment