Skip to content

Support procs for sign_in_after_reset_password config#5653

Open
excid3 wants to merge 5 commits intoheartcombo:mainfrom
excid3:sign-in-after-reset-password-proc
Open

Support procs for sign_in_after_reset_password config#5653
excid3 wants to merge 5 commits intoheartcombo:mainfrom
excid3:sign-in-after-reset-password-proc

Conversation

@excid3
Copy link
Contributor

@excid3 excid3 commented Nov 8, 2023

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 excid3 force-pushed the sign-in-after-reset-password-proc branch 2 times, most recently from cb65878 to 50e4ccd Compare November 8, 2023 17:59
@excid3 excid3 force-pushed the sign-in-after-reset-password-proc branch from 50e4ccd to 82a3d23 Compare November 8, 2023 18:36
@pglombardo
Copy link

This would be a good addition for better security out of the box.

@excid3
Copy link
Contributor Author

excid3 commented Mar 21, 2026

@carlosantoniodasilva I just updated this to work with 5.0. Would be nice not to have to override the controller to do this. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants