redirect to login page on 403

This commit is contained in:
Nabeel Shahzad 2017-06-20 11:49:44 -05:00
parent acff97dfb2
commit 94d0e15080

View File

@ -44,6 +44,11 @@ class Handler extends ExceptionHandler
*/
public function render($request, Exception $exception)
{
if ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException
&& $exception->getStatusCode() == 403) {
return redirect()->guest('login');
}
return parent::render($request, $exception);
}