Class: OmniAuth::Strategies::Password

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/password.rb

Instance Method Summary collapse

Instance Method Details

#callback_phaseObject



13
14
15
16
# File 'lib/omniauth/strategies/password.rb', line 13

def callback_phase
  return fail!(:invalid_credentials) unless user.try(:authenticate, password)
  super
end

#loginObject



26
27
28
# File 'lib/omniauth/strategies/password.rb', line 26

def 
  request[:sessions][options[:login_field].to_s]
end

#passwordObject



30
31
32
# File 'lib/omniauth/strategies/password.rb', line 30

def password
  request[:sessions]['password']
end

#request_phaseObject



9
10
11
# File 'lib/omniauth/strategies/password.rb', line 9

def request_phase
  redirect "/session/new"
end

#userObject



18
19
20
# File 'lib/omniauth/strategies/password.rb', line 18

def user
  @user ||= user_model.send("find_by_#{options[:login_field]}", )
end

#user_modelObject



22
23
24
# File 'lib/omniauth/strategies/password.rb', line 22

def user_model
  options[:user_model] || ::User
end