Open joost opened 15 years ago
I also get this issue, would you recommend "vendoring" the gem and applying this patch... Any chance of this patch getting applied?
I think jrallison should fix this minor bug as shown above. To make it work for now you can create a file in RAILS_ROOT/lib/authlogic_oauth_hacks.rb
# Replace following in lib/authlogic_oauth.rb.
# See: http://github.com/jrallison/authlogic_oauth/issues/#issue/3
#
# if defined?(Authlogic) # Fixes "undefined method `acts_as_authentic_config'" error when using rake.
# ActiveRecord::Base.send(:include, AuthlogicOauth::ActsAsAuthentic)
# Authlogic::Session::Base.send(:include, AuthlogicOauth::Session)
# ActionController::Base.helper AuthlogicOauth::Helper
# end
module AuthlogicOauth
module ActsAsAuthentic
module Methods
# Fixes issue. See: http://github.com/jrallison/authlogic_oauth/issues/#issue/2
def authenticating_with_oauth?
if session_class.controller
# Initial request when user presses one of the button helpers
(session_class.controller.params && !session_class.controller.params[:register_with_oauth].blank?) ||
# When the oauth provider responds and we made the initial request
(oauth_response && session_class.controller.session && session_class.controller.session[:oauth_request_class] == self.class.name)
end
end
end
end
Quite saddened that this project has seemingly been abandoned. This is quite the critical issue and I've had to patch it myself locally. jrallison, if you're still alive: PATCH THIS. We will love you forever.
I just hit this bug too.
me too
I get the following error when using the User model in a environment where there is no controller. Simplest solution is to add a condition to the authenticating_with_oauth? method in acts_as_authentic.rb:
The error:
You have a nil object when you didn't expect it! The error occurred while evaluating nil.params /opt/local/lib/ruby/gems/1.8/gems/authlogic-oauth-1.0.8/lib/authlogic_oauth/acts_as_authentic.rb:85:in
authenticating_with_oauth?' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:178:in
send'