From b787586514b5c024de858be72549c9bdf11a578e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 22 Jun 2016 08:48:58 -0500 Subject: [PATCH] expects json --- app/Exceptions/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 02af858b..03161fdd 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -55,7 +55,7 @@ public function render($request, Exception $e) */ protected function unauthenticated($request, AuthenticationException $e) { - if ($request->ajax() || $request->wantsJson()) { + if ($request->expectsJson()) { return response()->json(['error' => 'Unauthenticated.'], 401); } else { return redirect()->guest('login');