mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-26 02:40:41 -06:00
Fixed error while checking an API key that doesn't exist
This commit is contained in:
parent
4bd67d5f98
commit
a9f480ca99
@ -66,7 +66,7 @@ class AuthenticateAction extends AbstractRestAction
|
|||||||
|
|
||||||
// Authenticate using provided API key
|
// Authenticate using provided API key
|
||||||
$apiKey = $this->apiKeyService->getByKey($authData['apiKey']);
|
$apiKey = $this->apiKeyService->getByKey($authData['apiKey']);
|
||||||
if (! $apiKey->isValid()) {
|
if (! isset($apiKey) || ! $apiKey->isValid()) {
|
||||||
return new JsonResponse([
|
return new JsonResponse([
|
||||||
'error' => RestUtils::INVALID_API_KEY_ERROR,
|
'error' => RestUtils::INVALID_API_KEY_ERROR,
|
||||||
'message' => $this->translator->translate('Provided API key does not exist or is invalid.'),
|
'message' => $this->translator->translate('Provided API key does not exist or is invalid.'),
|
||||||
|
Loading…
Reference in New Issue
Block a user