Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise get user by reset_password_token

I'm trying to create password rules to devise recoverable password change. I did a super class via passwords_controller.rb, but I need to check the user role before aply the rules, but all that I have there is the reset_password_token.

like image 853
Elano Garcez Avatar asked Apr 01 '14 16:04

Elano Garcez


1 Answers

Assuming your model is User:

User.with_reset_password_token(your_token_here)

Source

like image 182
jb_9122 Avatar answered Oct 26 '22 12:10

jb_9122