Module: OmniAuth::Identity::Model::ClassMethods
- Extended by:
- Gem::Deprecate
- 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.
-
#create(*args) ⇒ Model
abstract
deprecated
Deprecated.
v4.0 will begin using #new with #save instead.
-
#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.
48 49 50 51 52 53 |
# File 'lib/omniauth/identity/model.rb', line 48 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.
38 39 40 41 42 43 |
# File 'lib/omniauth/identity/model.rb', line 38 def authenticate(conditions, password) instance = locate(conditions) return false unless instance instance.authenticate(password) end |
#create(*args) ⇒ Model
Deprecated.
v4.0 will begin using #new with OmniAuth::Identity::Model#save instead.
This method is abstract.
Persists a new Identity object to the ORM. Defaults to calling super. Override as needed per ORM.
63 64 65 66 67 |
# File 'lib/omniauth/identity/model.rb', line 63 def create(*args) raise NotImplementedError unless defined?(super) super end |
#locate(key) ⇒ Model
This method is abstract.
Locate an identity given its unique login key.
74 75 76 |
# File 'lib/omniauth/identity/model.rb', line 74 def locate(key) raise NotImplementedError end |