spree_social icon indicating copy to clipboard operation
spree_social copied to clipboard

NoMethodError occurred in omniauth_callbacks#facebook

Open jackkinsella opened this issue 11 years ago • 3 comments

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"}

jackkinsella avatar Jan 09 '14 08:01 jackkinsella

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?

radar avatar Jan 10 '14 04:01 radar

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 avatar Jan 13 '14 10:01 jackkinsella

@jackkinsella Have you been able to figure this one out yet?

radar avatar Feb 09 '14 22:02 radar