vendor/emprel/login-bundle/EventListener/ExceptionListener.php line 20

Open in your IDE?
  1. <?php
  2. /*
  3.  * Este arquivo é parte do package Login Bundle.
  4.  *
  5.  * (c) Laino Santos <lainosantos@recife.pe.gov.br>
  6.  *
  7.  * Para informações completas sobre copyright e licença, por favor ver o
  8.  * arquivo LICENCE distribuído juntamente com este código.
  9.  */
  10. namespace Emprel\Login\Bundle\EventListener;
  11. use Emprel\OpenIdUmaClient\Exceptions\RequiredLoginException;
  12. use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
  13. use Symfony\Component\Security\Core\Exception\CredentialsExpiredException;
  14. class ExceptionListener
  15. {
  16.     public function onKernelException(GetResponseForExceptionEvent $event): void
  17.     {
  18.         if ($event->getException() instanceof RequiredLoginException) {
  19.             $event->setException(new CredentialsExpiredException(""0$event->getException()));
  20.         }
  21.     }
  22. }