-
Notifications
You must be signed in to change notification settings - Fork 23
nil.params when using from console #2
Copy link
Copy link
Open
Description
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:
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
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:insend'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels