Module: Authlogic::Session::Password::InstanceMethods
- Defined in:
- lib/authlogic/session/password.rb
Overview
Password related instance methods
Instance Method Summary collapse
-
#credentials ⇒ Object
Returns the login_field / password_field credentials combination in hash form.
-
#credentials=(value) ⇒ Object
Accepts the login_field / password_field credentials combination in hash form.
- #initialize(*args) ⇒ Object
- #invalid_password? ⇒ Boolean
Instance Method Details
#credentials ⇒ Object
Returns the login_field / password_field credentials combination in hash form.
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/authlogic/session/password.rb', line 142 def credentials if authenticating_with_password? details = {} details[login_field.to_sym] = send(login_field) details[password_field.to_sym] = "<protected>" details else super end end |
#credentials=(value) ⇒ Object
Accepts the login_field / password_field credentials combination in hash form.
You must pass an actual Hash, ‘ActionController::Parameters` is specifically not allowed.
See ‘Authlogic::Session::Foundation#credentials=` for an overview of all method signatures.
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/authlogic/session/password.rb', line 161 def credentials=(value) super values = Array.wrap(value) if values.first.is_a?(Hash) values.first.with_indifferent_access.slice(login_field, password_field).each do |field, val| next if val.blank? send("#{field}=", val) end end end |
#initialize(*args) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/authlogic/session/password.rb', line 132 def initialize(*args) unless self.class.configured_password_methods configure_password_methods self.class.configured_password_methods = true end super end |
#invalid_password? ⇒ Boolean
172 173 174 |
# File 'lib/authlogic/session/password.rb', line 172 def invalid_password? invalid_password == true end |