Module: ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods

Defined in:
lib/action_controller/metal/http_authentication.rb

Instance Method Summary collapse

Instance Method Details

#http_basic_authenticate_with(options = {}) ⇒ Object



70
71
72
73
74
75
76
# File 'lib/action_controller/metal/http_authentication.rb', line 70

def http_basic_authenticate_with(options = {})
  before_action(options.except(:name, :password, :realm)) do
    authenticate_or_request_with_http_basic(options[:realm] || "Application") do |name, password|
      name == options[:name] && password == options[:password]
    end
  end
end