src/EventListener/AuthListener.php line 17

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\EventListener;
  4. use App\Entity\User\User;
  5. use App\Exception\BannedUserException;
  6. use Lexik\Bundle\JWTAuthenticationBundle\Event\JWTCreatedEvent;
  7. use Lexik\Bundle\JWTAuthenticationBundle\Exception\MissingTokenException;
  8. use Symfony\Component\HttpFoundation\JsonResponse;
  9. use Symfony\Component\HttpFoundation\RedirectResponse;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\Security\Core\Security;
  12. class AuthListener
  13. {
  14.     public function onAuthenticationSuccess(JWTCreatedEvent $event)
  15.     {
  16. //        if (!empty($event->getUser())) {
  17. //            if (!($event->getUser()->isVerified())) {
  18. //                throw new BannedUserException('Пользователь заблокирован');
  19. //            }
  20. //        }
  21.     }
  22. }