mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #2329 from int2001/api_debug
Added 401 in case of missing key to api/radio for easier debugging
This commit is contained in:
@@ -635,8 +635,9 @@ class API extends CI_Controller {
|
||||
$obj = json_decode(file_get_contents("php://input"), true);
|
||||
|
||||
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
|
||||
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
|
||||
die();
|
||||
http_response_code(401);
|
||||
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
|
||||
die();
|
||||
}
|
||||
|
||||
$this->api_model->update_last_used($obj['key']);
|
||||
|
||||
Reference in New Issue
Block a user