API returns "401 Unauthorized" if token is valid but method or endpoint don't exist #6549
Labels
area/backend
Needs backend code changes
area/frontend
Needs frontend code changes
bug
Something isn't working
kind/customer-request
Requested by one or more customers
Describe the issue
The API always return a 401 error even though the token is valid but the error is elsewhere such as a wrong method or wrong endpoint. It can be confusing for users. See Zendesk #299.
curl -X GET -H "Authorization: Bearer " localhost:8080/api/v1/production/me -> Working
curl -X POST -H "Authorization: Bearer " localhost:8080/api/v1/production/me -> 401 but should return method not allowed.
curl -X GET -H "Authorization: Bearer " localhost:8080/api/v1/production/moi -> 401 but should return a 404
Environment
The text was updated successfully, but these errors were encountered: