In advanced, the reason I look inside this function is the result I get in my front end when I access the URL : /wp-json/jwt-auth/v1/token
The result it is the following :
[{"code":"json_no_route","message":"No route was found matching the URL and request method"}]
Also, when I print_r the hook the result it’s like that:
Array
(
[hook] => rest_api_init
[component] => Jwt_Auth_Public Object
(
[plugin_name:Jwt_Auth_Public:private] => jwt-auth
[version:Jwt_Auth_Public:private] => 1.0.0
[namespace:Jwt_Auth_Public:private] => jwt-auth/v1
[jwt_error:Jwt_Auth_Public:private] =>
)
[callback] => add_cors_support
[priority] => 10
[accepted_args] => 1
)
that seems to be fine, but doesn’t work 🙁
Let me go through the normal questions:
1.- Are you using V2 https://ww.wp.xz.cn/plugins/rest-api/?
2.- Are you using pretty link structure?
3.- Are you on Local on a live server?
Hello tmeister.
Thansk a lot for your reply.
Yes all of the above and for the third answer yes I am on local LAMP stack.
My local computer runs the following :
PHP Version 5.6.4-4ubuntu6.2
Apache/2.4.10 (Ubuntu)
OK, so today I realized that I should install the v2 of the REST API plugin, while I though it was available by default.
After I installed the v2, the hooks are running, because now it is available the hook ‘rest_api_init’.
But now and while the routes are registered, the url http://www.my-server.com/wp-json/jwt-auth/v1/token still returns the following message:
[{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}]
I flushed the rewrite rules both by saving again the permalinks and by using the plugin “Rewrite Rules Inspector”, and the result remains the same.
Any idea for this issue ?
Kind regards
Merianos Nikos
Hey merianos,
Did you ever get this to work iam having the same issue.
j