Browse Source

Merge pull request #4275 from themsaid/updateAuthJSONError

Update JSON error message structure
Taylor Otwell 7 years ago
parent
commit
38a8390ce7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Exceptions/Handler.php

+ 1 - 1
app/Exceptions/Handler.php

@@ -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'));
     }
 }