-
-
Notifications
You must be signed in to change notification settings - Fork 976
Reset webauthn devices in reset 2FA action #6125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,9 +28,7 @@ def enable_user_mfa | |
|
|
||
| def disable_user_mfa | ||
| return unless user.no_mfa_devices? | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason, when calling I called |
||
| user.mfa_level = :disabled | ||
| user.new_mfa_recovery_codes = nil | ||
| user.mfa_hashed_recovery_codes = [] | ||
| user.reset_mfa_attributes | ||
| user.save!(validate: false) | ||
| end | ||
| end | ||
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.
Using
destroy_allis going to trigger thedisable_user_mfa&send_deletion_emailcallback for each webauthn device. Considering this is an admin action, should we switch this to bedelete_allto skip the callbacks? (I suspect this will also resolve your comment below)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.
Should we consider moving the idea of resetting MFA (OTP + WebAuthN) into a
User#reset_all_mfamethod to better capture everything and test for it?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.
Should we also consider wrapping this all in a transaction?
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.
The avo action is wrapped in a transaction so I think we're fine on that part.
I tried to move everything into
reset_all_mfa, have adelete_all, and only send one email instead of one per device. However, the audits are subscribed toactive_record.sqlevents and won't capture thedelete_allwebauthn cred records in the audit. It's going to take me a bit longer to implement getting these deleted records in the audit so I'm going to ship this as is to unblock the support request and come back to this after.