1

Tell me, how do I enter, via the module Services has, if I have "pass_reset_token" and then change the user password? How to password recovery. Tell me please! I'm desperate =(

2

Services user update function internally calls Drupal's user_account_form function (via user_profile_form). In user_account_form, it's specifically looking for pass-reset-token as a $_GET parameter, so to update password via Service, unfortunately you have to pass it as a GET parameter on a PUT call.

Example:

PUT https://drupal/:api-endpoint:/user/:uid:?pass-reset-token=:pass_reset_token: and the body is {"pass":":new-password"}.

If you wanted to be able to pass "pass_reset_token" as a parameter in the body, you could override _user_resource_update so that it checks if the pass_reset_token parameter is present and puts it into $_GET['pass-reset-token'] prior to calling user_profile_form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.