Class: Foobara::Auth::SetPassword

Inherits:
Command
  • Object
show all
Defined in:
foobara-auth-0.1.1/src/set_password.rb

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

install!

Methods included from TruncatedInspect

#inspect, truncating

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Attribute Details

#password_secretObject

Returns the value of attribute password_secret.



20
21
22
# File 'src/set_password.rb', line 20

def password_secret
  @password_secret
end

Instance Method Details

#build_passwordObject



22
23
24
# File 'src/set_password.rb', line 22

def build_password
  self.password_secret = run_subcommand!(BuildSecret, secret: plaintext_password)
end

#executeObject

TODO: should we enforce certain password requirements?



13
14
15
16
17
18
# File 'src/set_password.rb', line 13

def execute
  build_password
  set_password_on_user

  user
end

#set_password_on_userObject



26
27
28
# File 'src/set_password.rb', line 26

def set_password_on_user
  user.password_secret = password_secret
end