Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
undefined method `delete' for nil:NilClass #6
I am getting an occasional issue (3 occurrences in about 500 attempts) when users try to authenticate with Twitter. I am trying to fix the issue but I am not yet knowledgable enough on the internal workings of OmniAuth and figured someone else may be able to fix it faster. Here is the stack trace, url params, and session info of one of the failed requests:
Relevant Session Info:
referenced this issue
May 3, 2012
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
This error is occurring on our app's hand-rolled Twitter authentication implementation using the OAuth gem. Replacing the existing OAuth/SessionsController setup with Omniauth (based on the RailsCasts episode implementation) hasn't fixed the problem. In the OAuth setup there's a line in Sessions#create that deletes the request_token and request_secret from the session[:oauth] hash:
request_token = ::OAuth::RequestToken.new(consumer, session[:oauth].delete(:request_token), session[:oauth].delete(:request_secret))
However, the session[:oauth] disappears every so often by the time the user returns from Twitter, and .delete is being called on nil. It only seems to happen with Firefox or Camino.