As noted above, devise_token_auth has three API's calls to make for resetting a password.
1. A POST call to send a Passsword Reset Email
POST /auth/password
Params: 'email', 'redirect_url'
E.g.:
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST https://myapp.com/auth/password -d '{"email":"foo@gmail.com", "redirect_url": "https://myapp.com/auth/sign_in"}'
Note that the redirect_url given must correspond to the endpoint you want the user taken to for confirming and resetting their password.
E.g. if wanting redirect to somewhere within an iOS app, use the URL for that app scheme in the redirect_url definition. E.g. to manually do this on iOS:
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST https://myapp.com/auth/password -d '{"email":"foo@gmail.com", "redirect_url": "myappStoreAppName://auth/password/edit"}'
2. A GET call to verify the password reset token (clicked in email)
GET /auth/password/edit
Params: 'password_reset_token', 'redirect_url'
E.g. via our iOS app would produce an email link like this: https://myapp.com/auth/password/edit?config=default&redirect_url=myappStoreName%3A%2F%2Fauth%2Fpassword%2Fedit&reset_password_token=Qv6mkLuoy9zN-Y1pKghB
If this is from a web app, the 'redirect_to' link should point to a form where a password and password_confirmation form can be filled out. If the password reset email link points to a mobile app, it's up to that app to create the password reset form.
Most important in this step is knowing that the client making the request will get back an Access-Token HEADER from the Rails app.
This Access-Token needs to be saved, because it's what the client will use in the next request to keep the user authenticated while the user changes their password.
3. A PUT call to update the user's password
PUT /auth/password
Head: 'uid: VALUE', 'client: VALUE', 'access-token: VALUE', 'token-type: Bearer'
Params: 'password', 'password_confirmation'
Note the HEAD values that need to be supplied for this PUT call. These ensure our (now authenticated user) has permission to execute a change of password, and ensure that our user can continue to remain authenticated even after changing their password.
E.g. via curl:
curl -v -H 'Content-Type: application/json' -H 'uid: foo@gmail.com' -H 'client: U9FIDbiDbYVulsi1dBpxOQ' -H 'access-token: JbGQi97FTAwsW4n6SZ9aYQ' -H 'Accept: application/json' -X PUT https://myapp.com/auth/password -d '{"password": "foobar", "password_confirmation": "foobar"}'