module Authlogic::Session::HttpAuth::InstanceMethods

Instance methods for the HTTP basic auth feature of authlogic.

Private Instance Methods

allow_http_basic_auth?() click to toggle source
# File lib/authlogic/session/http_auth.rb, line 93
def allow_http_basic_auth?
  self.class.allow_http_basic_auth == true
end
persist_by_http_auth() click to toggle source
# File lib/authlogic/session/http_auth.rb, line 75
def persist_by_http_auth
  login_proc = Proc.new do |login, password|
    if !login.blank? && !password.blank?
      send("#{login_field}=", login)
      send("#{password_field}=", password)
      valid?
    end
  end

  if self.class.request_http_basic_auth
    controller.authenticate_or_request_with_http_basic(self.class.http_basic_auth_realm, &login_proc)
  else
    controller.authenticate_with_http_basic(&login_proc)
  end
        
  false
end
persist_by_http_auth?() click to toggle source
# File lib/authlogic/session/http_auth.rb, line 71
def persist_by_http_auth?
  allow_http_basic_auth? && login_field && password_field
end