Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions security/guard_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ property they use to access their account via the API::

public function getRoles()
{
return ['ROLE_USER'];
return array('ROLE_USER');
}

public function getPassword()
Expand Down Expand Up @@ -155,6 +155,7 @@ This requires you to implement six methods::

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
Expand Down Expand Up @@ -213,7 +214,7 @@ This requires you to implement six methods::
// $this->translator->trans($exception->getMessageKey(), $exception->getMessageData())
);

return new JsonResponse($data, 403);
return new JsonResponse($data, Response::HTTP_FORBIDDEN);
}

/**
Expand All @@ -226,7 +227,7 @@ This requires you to implement six methods::
'message' => 'Authentication Required'
);

return new JsonResponse($data, 401);
return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);
}

public function supportsRememberMe()
Expand Down