Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip validations when setting direct_otp #179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jmschneider
Copy link

If there is a validation error on the user model, it can lead to some unpredictable 2FA behavior. For example, the send_new_otp method will send a new OTP code to the user even if it failed to update the direct_otp column in the database. When this happens, the new code does not work for the user.

Looking at other devise modules, they tend to skip validations when saving data as well:

It seems like generating the direct_otp token is similar to a lot of these other cases where validation is skipped.

This should also fix #170

@jmschneider jmschneider reopened this Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rails 6.1 deprecation warning
1 participant