@@ -149,7 +149,7 @@ This requires you to implement six methods::
149
149
namespace AppBundle\Security;
150
150
151
151
use Symfony\Component\HttpFoundation\Request;
152
- use Symfony\Component\HttpFoundation\Response ;
152
+ use Symfony\Component\HttpFoundation\JsonResponse ;
153
153
use Symfony\Component\Security\Core\User\UserInterface;
154
154
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
155
155
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -217,7 +217,7 @@ This requires you to implement six methods::
217
217
// $this->translator->trans($exception->getMessageKey(), $exception->getMessageData())
218
218
);
219
219
220
- return new Response(json_encode( $data) , 403);
220
+ return new JsonResponse( $data, 403);
221
221
}
222
222
223
223
/**
@@ -230,7 +230,7 @@ This requires you to implement six methods::
230
230
'message' => 'Authentication Required'
231
231
);
232
232
233
- return new Response(json_encode( $data) , 401);
233
+ return new JsonResponse( $data, 401);
234
234
}
235
235
236
236
public function supportsRememberMe()
@@ -571,7 +571,3 @@ Frequently Asked Questions
571
571
to actually authenticate the user. You can continue doing that (see previous
572
572
question) or use the ``User `` object from FOSUserBundle and create your own
573
573
authenticator(s) (just like in this article).
574
-
575
- * :doc: `Creating a Login Form </cookbook/security/guard-login-form >`
576
- * :doc: `Authenticating with an API Token </cookbook/security/guard-api-key >`
577
- * :doc: `Using Multiple Authenticators (Login form *and* API Token) </cookbook/security/guard-multi >`
0 commit comments