jwt-auth icon indicating copy to clipboard operation
jwt-auth copied to clipboard

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

Open cientista opened this issue 5 years ago • 1 comments

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 avatar Oct 08 '19 14:10 cientista

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.

cientista avatar Oct 08 '19 15:10 cientista