Sha256: b1b4a8b08464c3b1c294d3999aa4b00557ee6d5a12143a3b6b1599a1c7c7f11a
Contents?: true
Size: 1.77 KB
Versions: 3
Compression:
Stored size: 1.77 KB
Contents
module Authlogic module ControllerAdapters # :nodoc: # Allows you to use Authlogic in any framework you want, not just rails. See the RailsAdapter # for an example of how to adapt Authlogic to work with your framework. class AbstractAdapter E_COOKIE_DOMAIN_ADAPTER = "The cookie_domain method has not been " \ "implemented by the controller adapter".freeze attr_accessor :controller def initialize(controller) self.controller = controller end def authenticate_with_http_basic @auth = Rack::Auth::Basic::Request.new(controller.request.env) if @auth.provided? && @auth.basic? yield(*@auth.credentials) else false end end def cookies controller.cookies end def cookie_domain raise NotImplementedError.new(E_COOKIE_DOMAIN_ADAPTER) end def params controller.params end def request controller.request end def request_content_type request.content_type end def session controller.session end def responds_to_single_access_allowed? controller.respond_to?(:single_access_allowed?, true) end def single_access_allowed? controller.send(:single_access_allowed?) end def responds_to_last_request_update_allowed? controller.respond_to?(:last_request_update_allowed?, true) end def last_request_update_allowed? controller.send(:last_request_update_allowed?) end def respond_to_missing?(*args) super(*args) || controller.respond_to?(*args) end private def method_missing(id, *args, &block) controller.send(id, *args, &block) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems