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



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

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

#strategy_error_messageObject

run!



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

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