2
0

Merge commit from fork

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

* Fix test coverage

---------

Co-authored-by: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
This commit is contained in:
Claire
2025-10-13 14:20:23 +02:00
committed by GitHub
parent 8477bec2f2
commit 1631fb80e8
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]