redirect to login page on 403
This commit is contained in:
@@ -44,6 +44,11 @@ class Handler extends ExceptionHandler
|
|||||||
*/
|
*/
|
||||||
public function render($request, Exception $exception)
|
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);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user