<?php
/*
* Este arquivo é parte do package Login Bundle.
*
* (c) Laino Santos <lainosantos@recife.pe.gov.br>
*
* Para informações completas sobre copyright e licença, por favor ver o
* arquivo LICENCE distribuído juntamente com este código.
*/
namespace Emprel\Login\Bundle\EventListener;
use Emprel\OpenIdUmaClient\Exceptions\RequiredLoginException;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\Security\Core\Exception\CredentialsExpiredException;
class ExceptionListener
{
public function onKernelException(GetResponseForExceptionEvent $event): void
{
if ($event->getException() instanceof RequiredLoginException) {
$event->setException(new CredentialsExpiredException("", 0, $event->getException()));
}
}
}