devise
devise copied to clipboard
Support procs for sign_in_after_reset_password config
Using MFA with Devise, it would be great to support callable objects in the sign_in_after_reset_password config.
Example
config.sign_in_after_reset_password = ->(resource) { !resource.mfa_enabled? }
Originally, I had to override the passwords controller to change this behavior but it's much cleaner if Devise supports procs, lambdas, or any other callable object.
The resource is passed as an argument so this can be applied based upon user preferences.