Class: Rails::Authentication::Strategies::Basic::Form
- Inherits:
-
Base
- Object
- Rails::Authentication::Strategy
- Base
- Rails::Authentication::Strategies::Basic::Form
- Defined in:
- lib/rails-auth/strategies/password_form.rb
Instance Attribute Summary
Attributes inherited from Rails::Authentication::Strategy
#body, #params, #request, #status
Instance Method Summary collapse
Methods inherited from Base
#login_param, login_param, password_param, #password_param
Methods inherited from Rails::Authentication::Strategy
abstract!, abstract?, after, before, #cookies, #halt!, #halted?, #headers, inherited, #initialize, #redirect!, #redirected?, #session, #user_class
Constructor Details
This class inherits a constructor from Rails::Authentication::Strategy
Instance Method Details
#run! ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rails-auth/strategies/password_form.rb', line 18 def run! if request.params[login_param] && request.params[password_param] user = user_class.authenticate(request.params[login_param], request.params[password_param]) if !user request.session.authentication.errors.clear! request.session.authentication.errors.add(login_param, ) end user end end |
#strategy_error_message ⇒ Object
run!
29 30 31 |
# File 'lib/rails-auth/strategies/password_form.rb', line 29 def "#{login_param.to_s.capitalize} or #{password_param.to_s.capitalize} were incorrect" end |