lib/boab/cms-bundle/src/Api/EventListener/JWTInvalidListener.php line 13

Open in your IDE?
  1. <?php
  2. namespace Boab\CmsBundle\Api\EventListener;
  3. use Lexik\Bundle\JWTAuthenticationBundle\Event\JWTInvalidEvent;
  4. use Lexik\Bundle\JWTAuthenticationBundle\Response\JWTAuthenticationFailureResponse;
  5. class JWTInvalidListener
  6. {
  7.     /**
  8.      * @param JWTInvalidEvent $event
  9.      */
  10.     public function onJWTInvalid(JWTInvalidEvent $event)
  11.     {
  12.         $response = new JWTAuthenticationFailureResponse('Your token is invalid, please login again to get a new one'403);
  13.         $event->setResponse($response);
  14.     }    
  15. }