Fix error logic if no API key passed to provisioning/create API
This commit is contained in:
parent
bda6a4585c
commit
84c21de578
|
@ -24,8 +24,12 @@ class ProvisioningHelper
|
|||
*/
|
||||
public function createAction()
|
||||
{
|
||||
$apikey = $_SERVER['PHP_AUTH_USER'];
|
||||
if (!isset($apikey) || $apikey != $this->apikey) {
|
||||
$apikey = "";
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
$apikey = $_SERVER['PHP_AUTH_USER'];
|
||||
}
|
||||
if ($apikey != $this->apikey) {
|
||||
Logging::info("Invalid API Key: $apikey");
|
||||
http_response_code(403);
|
||||
echo "ERROR: Incorrect API key";
|
||||
|
|
Loading…
Reference in New Issue