Sha256: 48133479b2c25018312476e5b2acaa27de5ea81a1a66a2ba2ad347822057db0b

Contents?: true

Size: 642 Bytes

Versions: 1

Compression:

Stored size: 642 Bytes

Contents

module Authlogic
  module ControllerAdapters # :nodoc:
    # = Abstract Adapter
    # Allows you to use Authlogic in any framework you want, not just rails. See tha RailsAdapter for an example of how to adapter Authlogic to work with your framework.
    class AbstractAdapter < SimpleDelegator
      def authenticate_with_http_basic(&block)
        @auth = Rack::Auth::Basic::Request.new(__getobj__.request.env)
        if @auth.provided? and @auth.basic?
          block.call(*@auth.credentials)
        else
          false
        end
      end
      
      def request_content_type
        request.content_type
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authlogic-1.2.2 lib/authlogic/controller_adapters/abstract_adapter.rb