Class: Merb::Authentication::Strategies::Multisite::Form
- Inherits:
-
Base
- Object
- Merb::Authentication::Strategy
- Base
- Merb::Authentication::Strategies::Multisite::Form
- Defined in:
- lib/merb-auth-more/strategies/multisite/multisite_password_form.rb
Overview
custom strategy taking into account site_id and authenticating with it the authenticate method is already well defined so for now I made a muck of if/else statements
Instance Method Summary collapse
Methods inherited from Base
#login_param, login_param, password_param, #password_param, site_id_param, #site_id_param
Instance Method Details
#run! ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/merb-auth-more/strategies/multisite/multisite_password_form.rb', line 58 def run! if (login = request.params[login_param]) && (password = request.params[password_param]) && (site_id = request.params[site_id_param]) user = user_class.all(site_id_param => site_id).authenticate(login, password) if !user errors = request.session.authentication.errors errors.clear! errors.add(login_param, ) end user end end |
#strategy_error_message ⇒ Object
run!
70 71 72 |
# File 'lib/merb-auth-more/strategies/multisite/multisite_password_form.rb', line 70 def "#{login_param.to_s.capitalize} or #{password_param.to_s.capitalize} were incorrect" end |