Search code examples
reactjswordpressjwtwordpress-rest-api

How to pass password value to wordpress using POST in JSON User API


I'm trying to create a registration page using ReactJS and WordPress. to create a user I use a plugin called JSON User API.

Link: https://wordpress.org/plugins/json-api-user/

I pass the password using POST request like this

https://localhost:8080/api/user/register/?username=test&email=test@test.com&password=test&nonce=0d1faff3b5&insecure=cool

it created the user however the password didn't save and I need to manually generate the password on the wordpress dashboard


wordpress-dashboard-user-setting

Is there a way to disable the generate password of WordPress or directly save the password to WordPress?


Solution

  • I just reviewed the API documentation at https://wordpress.org/plugins/json-api-user/

    It's says for method register you can pass a GET variable 'user_pass'. I included screeshot from source below.

    https://localhost:8080/api/user/register/?username=test&email=test@test.com&user_pass=test&nonce=0d1faff3b5&insecure=cool
    

    enter image description here