• Resolved germanoalves

    (@germanoalves)


    Congratulations on the plugin!

    I’m having difficulty using this plugin: – I have a multisite installation in “…./sys” and I am integrating with a Reactjs project. When making the POST request to “/sys/wp-json/bdpwr/v1….” I am getting ‘error 404’. I have already added the necessary lines in ‘functions.php’ function whitelist_auth_endpoints( $endpoints ) { $endpoints[] = ‘/sys/wp-json/bdpwr/v1/reset-password’; $endpoints[] = ‘/sys/wp-json/bdpwr/v1/set-password’; $endpoints[] = ‘/sys/wp-json/bdpwr/v1/validate-code’; return $endpoints; }; add_filter( ‘jwt_auth_whitelist’ , ‘whitelist_auth_endpoints’ , 10 , 1 ); And it didn’t solve it. Is there anything else I should do to make this work correctly?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author dominic_ks

    (@dominic_ks)

    Hello,

    Thank you for posting your issue.

    First, just a quick note to mention that the whitelist is only required if you are using the jwt-auth plugin as well, so if you’re not, those are not required.

    Before I look into your specific scenario further, can we confirm a few things?

    Firstly, you mention that the WordPress install is in a subdirectory, can you confirm that your home page URL also contains the subdirectory? e.g. example.com/sys/ – ?

    Secondly, to rule out any other issues caused by that setup, can you confirm that default WordPress REST API routes do work with the /sys/ part included? e.g. does https://example.com/sys/wp-json/wp/v2/posts/ work?

    • This reply was modified 1 year, 3 months ago by dominic_ks.
    Thread Starter germanoalves

    (@germanoalves)

    Thanks for your help!
    1 – yes, the project’s ‘home’ is at ‘site.com/sys”.

    2 – when accessing the route “https://site.com/sys/wp-json/wp/v2/posts/” the posts from the WordPress project are returned.

    And yes, I’m using the JWT Auth plugin.

    Is there anything else to do to make the plugin work?

    Plugin Author dominic_ks

    (@dominic_ks)

    Hello, thanks for that, I’m not sure of the cause of this right now, I’d need to try and get something set up in order to test your scenario, i.e. multisite in a subdirectory.

    It’s a strange one, since this plugin just registers the routes via the normal WordPress hooks I’d expect it to work along with the other REST API routes.

    How have you got the plugin activated? Is it at the multisite level? Or on a single site? And are you testing on the main site in the multisite or on a sub-site?

    Thread Starter germanoalves

    (@germanoalves)

    Hello! Thank you for your help! The plugin is amazing and the support is incredible! I uninstalled and reinstalled the plugin again and it worked! Thanks!

    Thread Starter germanoalves

    (@germanoalves)

    ^^

    Plugin Author dominic_ks

    (@dominic_ks)

    OK great! Ha, I didn’t notice that you’d opened both of those support requests. Glad it’s working now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘erro 404’ is closed to new replies.