Module: OmniAuth::Identity::Model::ClassMethods

Defined in:
lib/omniauth/identity/model.rb

Instance Method Summary collapse

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.


37
38
39
40
41
42
# File 'lib/omniauth/identity/model.rb', line 37

def auth_key(method = false)
  @auth_key = method.to_s unless method == false
  @auth_key = nil if @auth_key == ''

  @auth_key || 'email'
end

#authenticate(conditions, password) ⇒ Model

Authenticate a user with the given key and password.


28
29
30
31
32
# File 'lib/omniauth/identity/model.rb', line 28

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.

Raises:

  • (NotImplementedError)

19
20
21
# File 'lib/omniauth/identity/model.rb', line 19

def locate(key)
  raise NotImplementedError
end