Skip to content

Commit 0ceb3e5

Browse files
lsmith77xabbuh
authored andcommitted
fix access denied listener, add tests
1 parent e5d1474 commit 0ceb3e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

EventListener/AccessDeniedListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ public function onKernelException($event)
7474
}
7575

7676
if ($exception instanceof AccessDeniedException) {
77-
$exception = new AccessDeniedHttpException('You do not have the necessary permissions', $exception);
77+
$exception = new AccessDeniedHttpException('You do not have the necessary permissions');
7878
} elseif ($exception instanceof AuthenticationException) {
7979
if ($this->challenge) {
80-
$exception = new UnauthorizedHttpException($this->challenge, 'You are not authenticated', $exception);
80+
$exception = new UnauthorizedHttpException($this->challenge, 'You are not authenticated');
8181
} else {
82-
$exception = new HttpException(401, 'You are not authenticated', $exception);
82+
$exception = new HttpException(401, 'You are not authenticated');
8383
}
8484
}
8585

0 commit comments

Comments
 (0)