Treat unauthenticated exceptions the same as everything else
This commit is contained in:
parent
aba1b297c8
commit
a7fae86e58
|
@ -231,7 +231,7 @@ class Handler extends ExceptionHandler
|
|||
protected function unauthenticated($request, AuthenticationException $exception)
|
||||
{
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
||||
return response()->json(self::convertToArray($exception), 401);
|
||||
}
|
||||
|
||||
return redirect()->guest(route('auth.login'));
|
||||
|
|
Loading…
Reference in New Issue