clear security keys in disable_2fa rake task (#20586)
This commit is contained in:
parent
f6063c684b
commit
4350a903ec
|
@ -155,6 +155,7 @@ task "users:disable_2fa", [:username] => [:environment] do |_, args|
|
|||
username = args[:username]
|
||||
user = find_user(username)
|
||||
UserSecondFactor.where(user_id: user.id, method: UserSecondFactor.methods[:totp]).each(&:destroy!)
|
||||
UserSecurityKey.where(user_id: user.id).destroy_all
|
||||
puts "2FA disabled for #{username}"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue