Class: Merb::Authentication::Strategies::Basic::Form

Inherits:
Base
  • Object
show all
Defined in:
lib/merb-auth-more/strategies/basic/password_form.rb

Instance Method Summary collapse

Methods inherited from Base

#login_param, login_param, password_param, #password_param

Instance Method Details

#run!Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/merb-auth-more/strategies/basic/password_form.rb', line 19

def run!
  if ( = request.params[]) && (password = request.params[password_param])
    user = user_class.authenticate(, password)
    if !user
      errors = request.session.authentication.errors
      errors.clear!
      errors.add(, strategy_error_message)
    end
    user
  end
end

#strategy_error_messageObject

run!



31
32
33
# File 'lib/merb-auth-more/strategies/basic/password_form.rb', line 31

def strategy_error_message
  "#{.to_s.capitalize} or #{password_param.to_s.capitalize} were incorrect"
end