I have a basic WP site set up with the WP API 2 (beta13.1) and JWT plugins. If I make a call to the /token
endpoint while i'm already logged into WP, I get a successful response.
However, if I'm not logged in, I get a "No route was found matching the URL and request method"
message.
Upon further digging I can see in my servers access logs that the POST request is getting recieved as a GET request, so must be getting changed somewhere along the line, hence the error message I am seeing!
127.0.0.1 - - [06/Jun/2016:16:19:04 +0000] "GET /test/wp-json/jwt-auth/v1/token HTTP/1.1" 404 450 "http://localhost/test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0"
If I add a valid "wordpress_logged_in" cookie to the request, it works fine.
I can't figure out whats happening, the request to login a user shouldn't require the user to already be logged in!