FIX: Disable security keys at same time as TOTP 2FA (#10144)

Previously, the "Remove 2FA" button could result in an error. This syncs button visibility with behavior.

* FIX: Only offer disabling 2FA to admins
This commit is contained in:
Kane York
2020-07-07 12:19:30 -07:00
committed by GitHub
parent 81fe8a50d4
commit c86b1ee9d1
3 changed files with 25 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class AdminDetailedUserSerializer < AdminUserSerializer
end
def can_disable_second_factor
object&.id != scope.user.id
scope.is_admin? && (object&.id != scope.user.id)
end
def can_revoke_admin