devise icon indicating copy to clipboard operation
devise copied to clipboard

Support procs for sign_in_after_reset_password config

Open excid3 opened this issue 2 years ago • 0 comments

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.

excid3 avatar Nov 08 '23 16:11 excid3