Fixed AuthenticateAction not working with only one group of params

This commit is contained in:
Alejandro Celaya 2016-08-06 13:24:06 +02:00
parent 7b746f76b0
commit 99d7e6dd7d

View File

@ -44,7 +44,7 @@ class AuthenticateAction extends AbstractRestAction
public function dispatch(Request $request, Response $response, callable $out = null)
{
$authData = $request->getParsedBody();
if (! isset($authData['apiKey'], $authData['username'], $authData['password'])) {
if (! isset($authData['apiKey']) && ! isset($authData['username'], $authData['password'])) {
return new JsonResponse([
'error' => RestUtils::INVALID_ARGUMENT_ERROR,
'message' => $this->translator->translate(