expects json
This commit is contained in:
parent
51addd6c63
commit
b787586514
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue