Module: Sequel::Plugins::SequelAuth::InstanceMethods
- Defined in:
- lib/sequel_auth.rb
Overview
Instance methods
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
Instance Method Summary collapse
-
#authenticate(unencrypted) ⇒ Object
Authentication method.
-
#reset_access_token ⇒ Object
Access token reset.
-
#validate ⇒ Object
Validation method.
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
107 108 109 |
# File 'lib/sequel_auth.rb', line 107 def password @password end |
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
106 107 108 |
# File 'lib/sequel_auth.rb', line 106 def password_confirmation @password_confirmation end |
Instance Method Details
#authenticate(unencrypted) ⇒ Object
Authentication method
116 117 118 119 120 121 122 123 124 |
# File 'lib/sequel_auth.rb', line 116 def authenticate(unencrypted) if model.provider.matches?(self.send(model.digest_column), unencrypted) update_login_success self else update_login_failure nil end end |
#reset_access_token ⇒ Object
Access token reset
127 128 129 130 131 |
# File 'lib/sequel_auth.rb', line 127 def reset_access_token return unless model.access_token_column self.update(model.access_token_column => SecureRandom.urlsafe_base64(16)) end |
#validate ⇒ Object
Validation method
134 135 136 137 138 139 |
# File 'lib/sequel_auth.rb', line 134 def validate super run_basic_validations run_password_strength_validations if model.password_strength_enabled? end |