mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 12:40:40 +08:00
Merge pull request #6259 from pfaffman/patch-2
FIX: disable_2fa fix method selection
This commit is contained in:
commit
0f07494b12
|
@ -143,7 +143,7 @@ desc "Disable 2FA for user with the given username"
|
|||
task "users:disable_2fa", [:username] => [:environment] do |_, args|
|
||||
username = args[:username]
|
||||
user = find_user(username)
|
||||
UserSecondFactor.totp.where(user_id: user.id).each(&:destroy!)
|
||||
UserSecondFactor.where(user_id: user.id, method: UserSecondFactor.methods[:totp]).each(&:destroy!)
|
||||
puts "2FA disabled for #{username}"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user