Class: Foobara::Auth::CreateResetPasswordToken
- Defined in:
- foobara-auth-0.1.1/src/create_reset_password_token.rb
Constant Summary
Constants included from TruncatedInspect
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#reset_password_token_record ⇒ Object
Returns the value of attribute reset_password_token_record.
-
#reset_password_token_secret ⇒ Object
Returns the value of attribute reset_password_token_secret.
Instance Method Summary collapse
- #determine_timestamps ⇒ Object
- #execute ⇒ Object
- #generate_new_reset_password_token ⇒ Object
- #save_new_reset_password_token_on_user ⇒ Object
Methods inherited from Command
Methods included from TruncatedInspect
Methods included from Concern
foobara_class_methods_module_for, foobara_concern?, included
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
26 27 28 |
# File 'src/create_reset_password_token.rb', line 26 def expires_at @expires_at end |
#reset_password_token_record ⇒ Object
Returns the value of attribute reset_password_token_record.
26 27 28 |
# File 'src/create_reset_password_token.rb', line 26 def reset_password_token_record @reset_password_token_record end |
#reset_password_token_secret ⇒ Object
Returns the value of attribute reset_password_token_secret.
26 27 28 |
# File 'src/create_reset_password_token.rb', line 26 def reset_password_token_secret @reset_password_token_secret end |
Instance Method Details
#determine_timestamps ⇒ Object
28 29 30 31 |
# File 'src/create_reset_password_token.rb', line 28 def now = Time.now self.expires_at = now + token_ttl end |
#execute ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'src/create_reset_password_token.rb', line 17 def execute generate_new_reset_password_token save_new_reset_password_token_on_user reset_password_token_secret end |
#generate_new_reset_password_token ⇒ Object
33 34 35 36 37 38 |
# File 'src/create_reset_password_token.rb', line 33 def generate_new_reset_password_token result = run_subcommand!(CreateToken, expires_at:) self.reset_password_token_record = result[:token_record] self.reset_password_token_secret = result[:token_string] end |
#save_new_reset_password_token_on_user ⇒ Object
40 41 42 |
# File 'src/create_reset_password_token.rb', line 40 def save_new_reset_password_token_on_user user.reset_password_token = reset_password_token_record end |