Skip to content

Commit

Permalink
update for session user
Browse files Browse the repository at this point in the history
  • Loading branch information
vipin-shrivastava-webkul committed Dec 15, 2021
1 parent 2259e05 commit 33ab57a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EventListener/ExceptionSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function onKernelException(ExceptionEvent $event)
// a) If user session is set, display forbidden page
// b) If user session is not set, redirect to login page

if (!empty($this->user)) {
if (!empty($this->container->get('security.token_storage')->getToken()->getUser())) {
$template = $this->twig->render('errors/error.html.twig', [
'code' => 403,
'message' => 'Access Forbidden',
Expand Down Expand Up @@ -77,4 +77,4 @@ public function onKernelException(ExceptionEvent $event)
}
}
}
}
}

0 comments on commit 33ab57a

Please sign in to comment.