Sha256: 457c6635a01a443017c36a64eb0fa5d3c22af916cad73d2770cc5434f7f5dd9d

Contents?: true

Size: 587 Bytes

Versions: 10

Compression:

Stored size: 587 Bytes

Contents

module Authlogic
  module Session
    # Handles all authentication that deals with basic HTTP auth.
    module HttpAuth
      def self.included(klass)
        klass.persist :persist_by_http_auth
      end
      
      private
        def persist_by_http_auth
          controller.authenticate_with_http_basic do |login, password|
            if !login.blank? && !password.blank?
              send("#{login_field}=", login)
              send("#{password_field}=", password)
              return valid?
            end
          end
        
          false
        end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
authlogic-2.0.0 lib/authlogic/session/http_auth.rb
authlogic-2.0.1 lib/authlogic/session/http_auth.rb
authlogic-2.0.3 lib/authlogic/session/http_auth.rb
authlogic-2.0.5 lib/authlogic/session/http_auth.rb
authlogic-2.0.6 lib/authlogic/session/http_auth.rb
authlogic-2.0.7 lib/authlogic/session/http_auth.rb
authlogic-2.0.4 lib/authlogic/session/http_auth.rb
authlogic-2.0.8 lib/authlogic/session/http_auth.rb
authlogic-2.0.2 lib/authlogic/session/http_auth.rb
authlogic-2.0.9 lib/authlogic/session/http_auth.rb