Unverified Commit 6d1bdc23 authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #555 from navalkishore30/3.0

In case of accepts json then instead of redirecting sending unauthorised response
parents 53e86929 a13deea2
...@@ -49,7 +49,7 @@ class Authorization ...@@ -49,7 +49,7 @@ class Authorization
*/ */
private function handleUnauthorizedRequest(Request $request, $permission) private function handleUnauthorizedRequest(Request $request, $permission)
{ {
if ($request->ajax()) { if ($request->ajax() || $request->wantsJson()) {
return response('Unauthorized.', Response::HTTP_FORBIDDEN); return response('Unauthorized.', Response::HTTP_FORBIDDEN);
} }
if ($request->user() === null) { if ($request->user() === null) {
......
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