@ -165,14 +165,17 @@ module Mastodon::CLI
user . role_id = nil
user . role_id = nil
end
end
password = SecureRandom . hex if options [ :reset_password ]
user . password = password if options [ :reset_password ]
user . email = options [ :email ] if options [ :email ]
user . email = options [ :email ] if options [ :email ]
user . disabled = false if options [ :enable ]
user . disabled = false if options [ :enable ]
user . disabled = true if options [ :disable ]
user . disabled = true if options [ :disable ]
user . approved = true if options [ :approve ]
user . approved = true if options [ :approve ]
user . disable_two_factor! if options [ :disable_2fa ]
user . disable_two_factor! if options [ :disable_2fa ]
# Password changes are a little different, as we also need to ensure
# sessions, subscriptions, and access tokens are revoked after changing:
password = SecureRandom . hex if options [ :reset_password ]
user . change_password! ( password ) if options [ :reset_password ]
if user . save
if user . save
user . confirm if options [ :confirm ]
user . confirm if options [ :confirm ]