spree_social
spree_social copied to clipboard
NoMethodError occurred in omniauth_callbacks#facebook
Receiving a sporadic exception (one per 30-50 Facebook authentications) in production using the Spree 2-0-stable stack.
URL: /users/auth/facebook/callback?code=CODE
BACKTRACE:
A NoMethodError occurred in omniauth_callbacks#facebook:
undefined method `user' for nil:NilClass
vendor/bundle/ruby/1.9.1/bundler/gems/spree_social- 3b9139eaf8f9/app/controllers/spree/omniauth_callbacks_controller.rb:42:in `facebook'
SESSION (leaving in only the keys that had values)
data: {"_csrf_token"=>
"access_token"=> ,
"order_id"=> ,
"spree_user_return_to"=>"/checkout/payment",
"omniauth"=>
{"provider"=>"facebook",
"uid"=>,
"info"=>
{"nickname"=>
"name"=>
"first_name"=>
"last_name"=>
"image"=>
"description"=>
"location"=>
"verified"=>true},
"credentials"=>
{"token"=>
,
"expires_at"=>,
"expires"=>true}},
"_turbolinks_redirect_to"=>
"/user/spree_user/sign_up"}
Hi @jackkinsella,
This may be an issue when a user has a current order only, since that's where the stacktrace is pointing. We don't have a test for that at the moment in spree_social... could you try your hand at writing a regression test for this issue?
I took 15 minutes this morning but I couldn't even figure out where to start. With my deadlines crunching I have to pass on this one.
@jackkinsella Have you been able to figure this one out yet?