Skip to content

Commit

Permalink
Return a forbidden response code if unauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Sep 16, 2017
1 parent b3a544d commit 28c5439
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/Core/Http/Middleware/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 28c5439

Please sign in to comment.