From a7fae86e589ebe40b4671da82dcfafd422cf0893 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 14 Jul 2018 22:42:38 -0700 Subject: [PATCH] Treat unauthenticated exceptions the same as everything else --- 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 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'));