WP-API / jwt-auth

Enable JSON Web Token authentication for the WordPress REST API.
GNU General Public License v2.0
106 stars 25 forks source link

Can't generate key-pairs if wordpress is installed in a subfolder #19

Open cientista opened 5 years ago

cientista commented 5 years ago

I have some Wordpress installations in different subfolders and when why try generate key-pairs in the profile page nothing happens. After inspect the network request in browser inspector I noted that the subfolder is ignored on the request so it returns a 404.

For example the request made in "http://local.lab/wpapi/wp-admin/profile.php" on submission it requests on "http://local.lab/wp-json/wp/v2/key-pair/1" which returns a 404.

I don't know if is a mistake on my side but I tested in other server who also use the same installation system and the result is the same.

Thank you.

cientista commented 5 years ago

I temporary made it work editing the file "class-wp-rest-key-pair.php" adding my subdirectory in line 80 changing "$prefix = rest_get_url_prefix();" to "$prefix = "wpapi/" . rest_get_url_prefix();". After this change I can generate key-pairs normally.