-
Notifications
You must be signed in to change notification settings - Fork 84
Require a second factor to enable 2FA #12441
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
Conversation
YodaLightsabr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, please fix tests though
| user.update!(phone_number_verified: true) | ||
| user.update!(use_sms_auth: true) | ||
| user.update!(use_two_factor_authentication: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pass these in create?
| user.update!(phone_number_verified: true) | ||
| user.update!(use_sms_auth: true) | ||
| user.update!(use_two_factor_authentication: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pass these in create?
|
|
||
| it "can be enabled with SMS auth" do | ||
| user = create(:user, phone_number: "+18556254225", phone_number_verified: true) | ||
| user.update!(use_sms_auth: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pass this in create?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because of callbacks in the User model, any time the phone number is changed, use_sms_auth becomes false.
Closes #12419. Also adds a test for this!