diff --git a/plugins/api/API.php b/plugins/api/API.php index aeaa10a..f35b590 100644 --- a/plugins/api/API.php +++ b/plugins/api/API.php @@ -10,6 +10,12 @@ class API extends Plugin $this->config["key"] = sha1(rand() . uniqid()); $this->context->getConfig()->save(); } + + $headers = getallheaders(); + + if ($headers and isset($headers["X-Auth"]) and $headers["X-Auth"] == md5($this->config["key"])) { + $_SESSION["auth"] = true; + } } public function getKey(): string