Module: OmniAuth::Identity::Model::ClassMethods
- Defined in:
- lib/omniauth/identity/model.rb
Instance Method Summary collapse
-
#auth_key(method = false) ⇒ String
Used to set or retrieve the method that will be used to get and set the user-supplied authentication key.
-
#authenticate(conditions, password) ⇒ Model
Authenticate a user with the given key and password.
-
#locate(_key) ⇒ Model
abstract
Locate an identity given its unique login key.
Instance Method Details
#auth_key(method = false) ⇒ String
Used to set or retrieve the method that will be used to get and set the user-supplied authentication key.
50 51 52 53 54 55 |
# File 'lib/omniauth/identity/model.rb', line 50 def auth_key(method = false) @auth_key = method.to_s unless method == false @auth_key = nil if !defined?(@auth_key) || @auth_key == '' @auth_key || 'email' end |
#authenticate(conditions, password) ⇒ Model
Authenticate a user with the given key and password.
40 41 42 43 44 45 |
# File 'lib/omniauth/identity/model.rb', line 40 def authenticate(conditions, password) instance = locate(conditions) return false unless instance instance.authenticate(password) end |
#locate(_key) ⇒ Model
This method is abstract.
Locate an identity given its unique login key.
62 63 64 |
# File 'lib/omniauth/identity/model.rb', line 62 def locate(_key) raise NotImplementedError end |