DrupalGap icon indicating copy to clipboard operation
DrupalGap copied to clipboard

Password Reset in App

Open mkinnan opened this issue 9 years ago • 1 comments

When the user resets their password via the app, it sends them an email. When they click the link in the email to reset their password, it takes them to a browser. Once they reset, it keeps them in the browser. Is there a way to have the password reset take you back to the app to either (1) do the password change in the app, (2) in the browser and then once changed close the browser and open the app?

mkinnan avatar Dec 26 '16 18:12 mkinnan

@mkinnan There are 3 different Service Resources related to this:

  • request_new_password
  • user_pass_reset
  • password_reset

The first one I implemented for the Services module (specifically for DrupalGap, but helps all other Services users). The second and third one I've never actually used, but from reading the description of the second one, that seems like the one you want.

This is what it is described as doing:

Process one time login link and return the pass_reset_{uid} token to be used on user update operation

So I think you use it to get the reset token, which will allow the user account to be updated (aka set a new password), and that token needs to be included in the PUT data for verification. However, I don't know how it actually works, and would need a little reverse engineering. The code that powers it is here:

http://cgit.drupalcode.org/services/tree/resources/user_resource.inc?h=7.x-3.x#n745

You'd have to build your own interface for this, but hopefully it can be abstracted and used throughout DG.

signalpoint avatar Dec 27 '16 18:12 signalpoint