From 28c543946c3fe79049504ec6a1a8ea98739dfa12 Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Sat, 16 Sep 2017 20:41:02 +0200 Subject: [PATCH] Return a forbidden response code if unauthorized --- Modules/Core/Http/Middleware/Authorization.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Core/Http/Middleware/Authorization.php b/Modules/Core/Http/Middleware/Authorization.php index d2fe4b4e0..7808d3e7b 100644 --- a/Modules/Core/Http/Middleware/Authorization.php +++ b/Modules/Core/Http/Middleware/Authorization.php @@ -50,7 +50,7 @@ public function handle($request, \Closure $next, $permission) private function handleUnauthorizedRequest(Request $request, $permission) { if ($request->ajax()) { - return response('Unauthorized.', Response::HTTP_UNAUTHORIZED); + return response('Unauthorized.', Response::HTTP_FORBIDDEN); } if ($request->user() === null) { return redirect()->guest('auth/login');