77
88declare (strict_types=1 );
99
10- namespace OxidEsales \SecurityModule \Authentication \TwoFactorAuth \ Subscriber ;
10+ namespace OxidEsales \SecurityModule \Authentication \Subscriber ;
1111
1212use OxidEsales \Eshop \Core \Config ;
1313use OxidEsales \Eshop \Core \Request ;
1414use OxidEsales \EshopCommunity \Internal \Framework \Session \SessionInterface ;
1515use OxidEsales \EshopCommunity \Internal \Transition \ShopEvents \ViewRenderedEvent ;
16- use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \ Service \ AuthorizeService ;
16+ use OxidEsales \SecurityModule \Authentication \Session \ SessionKeys ;
1717use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
1818
1919readonly class StoreCurrentUrlSubscriber implements EventSubscriberInterface
2020{
21- public function __construct (private SessionInterface $ session , private Config $ config , private Request $ request )
22- {
23- }
24-
2521 private const EXCLUDED_CONTROLLERS = [
2622 'twofactorauth ' ,
23+ 'oauth ' ,
2724 ];
2825
2926 private const EXCLUDED_FUNCTIONS = [
3027 'logout ' ,
3128 ];
3229
30+ public function __construct (
31+ private SessionInterface $ session ,
32+ private Config $ config ,
33+ private Request $ request
34+ ) {
35+ }
36+
3337 public static function getSubscribedEvents (): array
3438 {
3539 return [
@@ -49,7 +53,6 @@ public function onViewRendered(ViewRenderedEvent $event): void
4953 $ currentController = $ this ->getCurrentController ();
5054 $ currentFunction = $ this ->getCurrentFunction ();
5155
52- // Skip widgets, excluded controllers, and excluded functions (like logout)
5356 if (
5457 $ this ->isWidget ($ currentController )
5558 || $ this ->shouldExcludeController ($ currentController )
@@ -60,7 +63,7 @@ public function onViewRendered(ViewRenderedEvent $event): void
6063
6164 $ currentUrl = $ this ->getCurrentPageUrl ();
6265 if ($ currentUrl ) {
63- $ this ->session ->set (AuthorizeService:: OTP_TARGET_URL , $ currentUrl );
66+ $ this ->session ->set (SessionKeys:: AUTH_REDIRECT_URL , $ currentUrl );
6467 }
6568 }
6669
0 commit comments