From 61a55c888889a1ec3376a7a3bba230dc15a378a4 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 30 Jan 2019 20:59:25 -0800 Subject: Check if user role has changed while the session is open --- app/Middleware/AuthenticationMiddleware.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/Middleware') diff --git a/app/Middleware/AuthenticationMiddleware.php b/app/Middleware/AuthenticationMiddleware.php index 54652e57..7eb9f745 100644 --- a/app/Middleware/AuthenticationMiddleware.php +++ b/app/Middleware/AuthenticationMiddleware.php @@ -20,7 +20,8 @@ class AuthenticationMiddleware extends BaseMiddleware public function execute() { if (! $this->authenticationManager->checkCurrentSession()) { - throw AccessForbiddenException::getInstance()->withoutLayout(); + $this->response->redirect($this->helper->url->to('AuthController', 'login')); + return; } if (! $this->isPublicAccess()) { -- cgit v1.2.3