mercredi 28 octobre 2015

Reset password via API (doorkeeper) for devise

I am using devise and I want to reset password from native app (API) which is done throught doorkeeper ( oauth2 gem).

Actual requirement is to set password from native app using API. when 'reset password instruction' email will be sent to user, I want user to be able to reset password from API with three fields on APP side: password, confirm_password and reset_code (which should come from email also that should be simple 6 digit )

I found some solution to generate token for devise is like below:

 raw_token, hashed_token = Devise.token_generator.generate(User, :reset_password_token) 

But, I am not sure how should I re-set simple matchable and reset_password_token for API, which can be filled via custom form.

Please guide.

Aucun commentaire:

Enregistrer un commentaire