1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-24 05:43:10 +02:00

feat(core): update routes validation for API's #349

This commit is contained in:
Awilum
2020-01-14 17:29:47 +03:00
parent 39146d578a
commit ed285f101a

View File

@@ -43,7 +43,7 @@ $app->get('/api/entries', function (Request $request, Response $response) use ($
// Set delivery token file
if ($delivery_token_file_data = $flextype['parser']->decode(Filesystem::read($delivery_token_file_path), 'yaml')) {
if ($delivery_token_file_data['state'] == 'disabled' ||
$delivery_token_file_data['limit_calls'] <= $delivery_token_file_data['calls']) {
($delivery_token_file_data['limit_calls'] != 0 && $delivery_token_file_data['calls'] >= $delivery_token_file_data['limit_calls'])) {
return $response->withJson(["detail" => "Incorrect authentication credentials."], 401);
} else {
// Fetch entry