I'm dealing with a Devise User model with an optional email attribute (he can login with document number or email). Since admins can register new users (setting his password), I would like to know if there's a way to users recover their devise password using document number and birthdate, to then, register a new password.
Hope that was clear. Thanks.
My solution was based on @Alex answer. I did a custom password reset view.
When dealing with password requirement on devise model, there are two (or more) options:
First, we can override the devise password requirement method. This would save a model object without password:
Or we can set a simple token after the object creation:
Optionally, put the behavior above on model:
Briefly, that was the solution, including a view with birthday, password and password confirmation, validating the data on controller and overriding the password.