
activate_authlogic sometimes not automatically attached
Reported by Walter Smith | July 4th, 2009 @ 12:33 AM
The RailsAdapter relies on being loaded before any of the app's controllers, so it can put activate_authlogic in ActionController::Base's filter_chain before it gets copied to the subclasses. However, there's no guarantee this is the case.
For example, if you happen to put giraffesoft-resource_controller's gem statement ahead of authlogic's, it doesn't work. Resource_controller requires ApplicationController, so the filter_chain is initialized before authlogic gets a crack at it.
This results in the dreaded Authlogic::Session::Activation::NotActivatedError (You must activate the Authlogic::Session::Base.controller with a controller object before creating objects).
The workaround is just to make sure authlogic is loaded before
any conflicting gems. If there's no foolproof way to ensure the
filter gets installed, it would be nice if authlogic could just
detect this case and save potential hours of frustration. E.g.,
like this:
module RailsImplementation
def self.included(klass) # :nodoc:
+ STDERR.puts "Warning: authlogic loaded too late!" if defined?(::ApplicationController)
klass.prepend_before_filter :activate_authlogic
end
Comments and changes to this ticket
-
Ben Johnson July 4th, 2009 @ 01:32 AM
- State changed from new to resolved
I agree. Thanks for this, this has been applied.
-
-
Rearts zbaerves January 30th, 2022 @ 08:47 AM
Activate is designed to simplify the authorization process, save time and help you be more productive. It provides a simple interface that allows you to do my essay review and edit authentication information as well as create your own authorization logic.
-
-
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.