2
0

Merge commit from fork

* Ensure tootctl revokes sessions, access tokens and web push subscriptions

* Fix test coverage
This commit is contained in:
Emelia Smith
2025-10-13 14:20:23 +02:00
committed by GitHub
parent 8d09e4ef23
commit 24dcb18013
3 changed files with 25 additions and 8 deletions

View File

@@ -165,14 +165,17 @@ module Mastodon::CLI
user.role_id = nil
end
password = SecureRandom.hex if options[:reset_password]
user.password = password if options[:reset_password]
user.email = options[:email] if options[:email]
user.disabled = false if options[:enable]
user.disabled = true if options[:disable]
user.approved = true if options[:approve]
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
user.confirm if options[:confirm]