From 9fa21c3528c751e9ff087277df68a4ea707e350d Mon Sep 17 00:00:00 2001 From: Konrad Oboza Date: Mon, 1 Jul 2024 16:12:12 +0200 Subject: [PATCH] IBX-8322: Fixed lack of redirections to last visited pages after successful authentication (#389) For more details see https://issues.ibexa.co/browse/IBX-8322 and https://github.com/ibexa/core/pull/389 Key changes: * Fixed lack of redirections to last visited pages after successful authentication --- src/bundle/Core/Resources/config/security.yml | 4 -- .../AccessDeniedSubscriber.php | 46 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 src/lib/MVC/Symfony/Security/Authentication/EventSubscriber/AccessDeniedSubscriber.php diff --git a/src/bundle/Core/Resources/config/security.yml b/src/bundle/Core/Resources/config/security.yml index fb74525faf..cc0f36177d 100644 --- a/src/bundle/Core/Resources/config/security.yml +++ b/src/bundle/Core/Resources/config/security.yml @@ -44,10 +44,6 @@ services: ibexa.security.user_provider.username: '@Ibexa\Core\MVC\Symfony\Security\User\UsernameProvider' ibexa.security.user_provider.email: '@Ibexa\Core\MVC\Symfony\Security\User\EmailProvider' - Ibexa\Core\MVC\Symfony\Security\Authentication\EventSubscriber\AccessDeniedSubscriber: - autowire: true - autoconfigure: true - Ibexa\Core\MVC\Symfony\Security\Authentication\EventSubscriber\OnAuthenticationTokenCreatedRepositoryUserSubscriber: autowire: true autoconfigure: true diff --git a/src/lib/MVC/Symfony/Security/Authentication/EventSubscriber/AccessDeniedSubscriber.php b/src/lib/MVC/Symfony/Security/Authentication/EventSubscriber/AccessDeniedSubscriber.php deleted file mode 100644 index 892ce86ebc..0000000000 --- a/src/lib/MVC/Symfony/Security/Authentication/EventSubscriber/AccessDeniedSubscriber.php +++ /dev/null @@ -1,46 +0,0 @@ - ['onKernelException', 2], - ]; - } - - public function onKernelException(ExceptionEvent $event): void - { - $exception = $event->getThrowable()->getPrevious(); - - if ($exception instanceof IbexaRepositoryException) { - return; - } - - $event->setResponse(new RedirectResponse( - $this->urlGenerator->generate('login') - )); - } -}