mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-25 18:30:23 -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
|
||||
$apiKey = $this->apiKeyService->getByKey($authData['apiKey']);
|
||||
if (! $apiKey->isValid()) {
|
||||
if (! isset($apiKey) || ! $apiKey->isValid()) {
|
||||
return new JsonResponse([
|
||||
'error' => RestUtils::INVALID_API_KEY_ERROR,
|
||||
'message' => $this->translator->translate('Provided API key does not exist or is invalid.'),
|
||||
|
Loading…
Reference in New Issue
Block a user