Class: OmniAuth::Strategies::Password
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Password
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/password.rb
Instance Method Summary collapse
- #callback_phase ⇒ Object
- #login ⇒ Object
- #password ⇒ Object
- #request_phase ⇒ Object
- #user ⇒ Object
- #user_model ⇒ Object
Instance Method Details
#callback_phase ⇒ Object
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 |
#login ⇒ Object
26 27 28 |
# File 'lib/omniauth/strategies/password.rb', line 26 def login request[:sessions][[:login_field].to_s] end |
#password ⇒ Object
30 31 32 |
# File 'lib/omniauth/strategies/password.rb', line 30 def password request[:sessions]['password'] end |
#request_phase ⇒ Object
9 10 11 |
# File 'lib/omniauth/strategies/password.rb', line 9 def request_phase redirect "/session/new" end |
#user ⇒ Object
18 19 20 |
# File 'lib/omniauth/strategies/password.rb', line 18 def user @user ||= user_model.send("find_by_#{[:login_field]}", login) end |
#user_model ⇒ Object
22 23 24 |
# File 'lib/omniauth/strategies/password.rb', line 22 def user_model [:user_model] || ::User end |