src/EventListener/AuthenticationSuccessListener.php line 12

Open in your IDE?
  1. <?php 
  2. namespace App\EventListener;
  3. use Lexik\Bundle\JWTAuthenticationBundle\Event\AuthenticationSuccessEvent;
  4. class AuthenticationSuccessListener {
  5.   /**
  6.    * @param AuthenticationSuccessEvent $event
  7.    */
  8.   public function onAuthenticationSuccessResponse(AuthenticationSuccessEvent $event)
  9.   {
  10.     $data $event->getData();
  11.     $user $event->getUser();
  12.     if (!$user instanceof UserInterface) {
  13.       return;
  14.     }
  15.     $event->setData($data);
  16.   }
  17. }