Merge pull request #4275 from themsaid/updateAuthJSONError

Update JSON error message structure
This commit is contained in:
Taylor Otwell
2017-05-25 08:00:22 -05:00
committed by GitHub

View File

@@ -52,7 +52,7 @@ class Handler extends ExceptionHandler
protected function unauthenticated($request, AuthenticationException $exception)
{
return $request->expectsJson()
? response()->json(['error' => 'Unauthenticated.'], 401)
? response()->json(['message' => 'Unauthenticated.'], 401)
: redirect()->guest(route('login'));
}
}