Commit 608b2a3d authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fix pcs disable

parent c1f112ee
......@@ -260,14 +260,19 @@ class HumanVerification extends Controller
if (!preg_match("/^[a-f0-9]{32}$/", $key) || !$request->filled("c")) {
abort(404);
}
$picasso_hash = $request->input('c');
$picasso_hash = null;
if ($request->filled("c")) {
$picasso_hash = $request->input('c');
}
$bvData = Cache::get($key);
if ($bvData === null) {
$bvData = [];
}
$bvData["js_loaded"] = now();
$bvData["js_picasso"] = $picasso_hash;
if (!empty($picasso_hash)) {
$bvData["js_picasso"] = $picasso_hash;
}
Cache::put($key, $bvData, now()->addSeconds(30));
return response()->file(\public_path("img/1px.png", ["Content-Type" => "image/png"]));
......
......@@ -4,8 +4,9 @@ require('fetch-ie8');
import picassoCanvas from './picasso';
// This is the result of the picasso canvas fingerprint that we'll submit back to our server
let canvasValue = null;
if (document.location.href.match(/\/\/metager\.org/i) !== null) {
const canvasValue = picassoCanvas();
canvasValue = picassoCanvas();
}
// Find the key id for the browser-verification
......@@ -16,7 +17,10 @@ document.querySelectorAll("link").forEach(element => {
return true;
}
let key = matches[1];
let url = "/img/logo.png?id=" + key + "&c=" + canvasValue;
let url = "/img/logo.png?id=" + key;
if (canvasValue !== null) {
url += "&c=" + canvasValue;
}
return fetch(url);
});
......
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