diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index a5c9c8103c4..dbbcad0d245 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -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