Sha256: d28fe840c64d7167e924a7341e96ff6c831f6c6ec8691dd026b1bb617ecd5662
Contents?: true
Size: 1018 Bytes
Versions: 14
Compression:
Stored size: 1018 Bytes
Contents
module Authlogic module ControllerAdapters # Adapts authlogic to work with merb. The point is to close the gap between what authlogic expects and what the merb controller object # provides. Similar to how ActiveRecord has an adapter for MySQL, PostgreSQL, SQLite, etc. class MerbAdapter < AbstractAdapter # Lets Authlogic know about the controller object via a before filter, AKA "activates" authlogic. module MerbImplementation def self.included(klass) # :nodoc: klass.before :activate_authlogic end def cookie_domain Merb::Config[:session_cookie_domain] end private def activate_authlogic Authlogic::Session::Base.controller = MerbAdapter.new(self) end end end end end # make sure we're running inside Merb if defined?(Merb::Plugins) Merb::BootLoader.before_app_loads do Merb::Controller.send(:include, Authlogic::ControllerAdapters::MerbAdapter::MerbImplementation) end end
Version data entries
14 entries across 14 versions & 1 rubygems