Closed jkmassel closed 5 years ago
I think a token should be always verified if provided. If the token is invalid the API should bail no matter what the request method was. An example would be a request for GET /wp-json/wp/v2/users/me
.
Sounds good – I'll update this PR to reflect that behaviour.
@ocean90 – this has been updated per your suggestion.
Some
GET
requests need to use tokens. Consider the following request:Before: It'll return an error saying
Invalid parameter(s): status
After It'll correctly return any draft posts
This PR addresses this by treating the presence of a valid
Bearer
token as an indication that the request should proceed as a logged-in user. If an invalidBearer
token is passed, the request proceeds as if it weren't present. This may be incorrect behaviour – we may wish to always treat the presence of a token, valid or not, as an indication that it's required.