diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 9be53eb4f..a25990569 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -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'));