francescomalatesta / laravel-api-boilerplate-jwt

A Laravel 5.8 API Boilerplate to create a ready-to-use REST API in seconds.
MIT License
1.17k stars 285 forks source link

500 Internal Server Error #61

Closed zhdanovartur closed 6 years ago

zhdanovartur commented 6 years ago

API returns 500 HTTP status code on /user/me for unauthenticated requests:

{
"error":{
    "message": "Unauthenticated.",
    "status_code": 500
  }
}

but I expect 401.

zhdanovartur commented 6 years ago

The problem is here Use following:

$this->middleware('api.auth', []);

instead of

$this->middleware('auth:api', []);

to fix it.

francescomalatesta commented 6 years ago

The correct one is "jwt.auth", closing