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:
		@@ -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]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user