1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Using User#disable_two_factor! when disabling a user's two-factor via admin cli

This commit is contained in:
MszPro 2024-04-10 14:27:33 +09:00
parent 6df3006831
commit d068fd8b5e
No known key found for this signature in database
GPG key ID: ACF2C257EB79C31C

View file

@ -165,8 +165,7 @@ module Mastodon::CLI
user.disabled = false if options[:enable]
user.disabled = true if options[:disable]
user.approved = true if options[:approve]
user.otp_required_for_login = false if options[:disable_2fa]
user.webauthn_credentials = [] if options[:disable_2fa]
user.disable_two_factor! if options[:disable_2fa]
if user.save
user.confirm if options[:confirm]