mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Merge commit from fork
* Ensure tootctl revokes sessions, access tokens and web push subscriptions * Fix test coverage
This commit is contained in:
parent
8d09e4ef23
commit
24dcb18013
3 changed files with 25 additions and 8 deletions
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue