File tree 1 file changed +2
-4
lines changed
src/Symfony/Component/Security/Http/Firewall
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ public function onKernelException(GetResponseForExceptionEvent $event)
97
97
return ;
98
98
}
99
99
} elseif ($ exception instanceof AccessDeniedException) {
100
+ $ event ->setException (new AccessDeniedHttpException ($ exception ->getMessage (), $ exception ));
101
+
100
102
$ token = $ this ->context ->getToken ();
101
103
if (!$ this ->authenticationTrustResolver ->isFullFledged ($ token )) {
102
104
if (null !== $ this ->logger ) {
@@ -129,8 +131,6 @@ public function onKernelException(GetResponseForExceptionEvent $event)
129
131
$ response = $ event ->getKernel ()->handle ($ subRequest , HttpKernelInterface::SUB_REQUEST , true );
130
132
$ response ->setStatusCode (403 );
131
133
} else {
132
- $ event ->setException (new AccessDeniedHttpException ($ exception ->getMessage (), $ exception ));
133
-
134
134
return ;
135
135
}
136
136
} catch (\Exception $ e ) {
@@ -148,8 +148,6 @@ public function onKernelException(GetResponseForExceptionEvent $event)
148
148
$ this ->logger ->info (sprintf ('Logout exception occurred; wrapping with AccessDeniedHttpException (%s) ' , $ exception ->getMessage ()));
149
149
}
150
150
151
- $ event ->setException (new AccessDeniedHttpException ($ exception ->getMessage (), $ exception ));
152
-
153
151
return ;
154
152
} else {
155
153
return ;
You can’t perform that action at this time.
0 commit comments