src/EventListener/AuthenticationFailureListener.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. use Symfony\Component\HttpFoundation\JsonResponse;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
  6. use Symfony\Component\Security\Core\Exception\AuthenticationException;
  7. class AuthenticationFailureListener implements AuthenticationFailureHandlerInterface
  8. {
  9.         
  10.         public function onAuthenticationFailure(Request $requestAuthenticationException $exception): JsonResponse
  11.         {
  12.                 return new JsonResponse(status401);
  13.         }
  14. }