Return a forbidden response code if unauthorized

parent b3a544d5
......@@ -50,7 +50,7 @@ class Authorization
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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment