0

Spree 3.1 in Heroku. After installed gem 'spree_social', :git=> 'https://github.com/spree-contrib/spree_social', branch: '3-1-stable' and setup as described in the gem doc.and developer.facebook.com I could not login using facebook butoon

Both development and production kept asking for

One more step to complete your registration from Facebook

What possible gone wrong? :already setup FB APP ID and FB APP Secret in Spree :Setup App Domains with http://sub.domain.com :Yes on Client OAuth Login and Web OAuth Login :No Force Web OAuth Reauthentication and Embedded Browser OAuth Login

FB Setting FB Login Setting

It's asked everytime when click FB Login then fill-in user/password (as it supposed to be only first time only.?

One more step to complete your registration from Facebook

$heroku logs -t

2016-11-30T18:39:08.242440+00:00 app[web.1]: Started GET "/users/auth/facebook" for 24.253.3.125 at 2016-11-30 18:39:08 +0000
2016-11-30T18:39:08.245300+00:00 app[web.1]: I, [2016-11-30T18:39:08.245245 #4]  INFO -- omniauth: (facebook) Calling through to underlying application for setup.
2016-11-30T18:39:08.246504+00:00 app[web.1]: I, [2016-11-30T18:39:08.246446 #4]  INFO -- omniauth: (facebook) Request phase initiated.
2016-11-30T18:39:08.690859+00:00 app[web.1]: Started GET "/users/auth/facebook/callback?code=AQCvn-9bgYXYsw8J4rMHzaXkQFzulZKWrxVzokGsi6l2adj2zsDTB5YUTPoCEwzjLcEdGGohpfuIJ7r_QtiABIdoIBLKTDCtfms2v6jW7yjE7VfthoHgpvRtsJXz8xJL2pIp6BmvHHxq9Ahfnjir3GzWTjbMLJ_300LgpAMoy0PHsjAZh6nzIpyaiQ_PD4HWSqaHfMQds2r-Yd88gS8qJRvvO2qwkBQEXj-4Uaer4uhOnnRKs05SxRrQZAc0mE-gHBiHT-8NXWzmQMEvepBTNJllAfJdamhW78NisYcLHRZRwU0FDyyUVQU5YcIk4vAI_yQ9JKvlpvlNx2fdnw8E5wn45tSs_mZiSgoLhU8Cxg2jBg&state=eb30a2462d75546d28439534dcc560761a5eafefa5b47a75" for 24.253.3.125 at 2016-11-30 18:39:08 +0000
2016-11-30T18:39:08.692550+00:00 app[web.1]: I, [2016-11-30T18:39:08.692484 #4]  INFO -- omniauth: (facebook) Calling through to underlying application for setup.
2016-11-30T18:39:08.693727+00:00 app[web.1]: I, [2016-11-30T18:39:08.693638 #4]  INFO -- omniauth: (facebook) Callback phase initiated.
2016-11-30T18:39:08.927577+00:00 app[web.1]: Processing by Spree::OmniauthCallbacksController#facebook as HTML
2016-11-30T18:39:08.927612+00:00 app[web.1]:   Parameters: {"code"=>"AQCvn-9bgYXYsw8J4rMHzaXkQFzulZKWrxVzokGsi6l2adj2zsDTB5YUTPoCEwzjLcEdGGohpfuIJ7r_QtiABIdoIBLKTDCtfms2v6jW7yjE7VfthoHgpvRtsJXz8xJL2pIp6BmvHHxq9Ahfnjir3GzWTjbMLJ_300LgpAMoy0PHsjAZh6nzIpyaiQ_PD4HWSqaHfMQds2r-Yd88gS8qJRvvO2qwkBQEXj-4Uaer4uhOnnRKs05SxRrQZAc0mE-gHBiHT-8NXWzmQMEvepBTNJllAfJdamhW78NisYcLHRZRwU0FDyyUVQU5YcIk4vAI_yQ9JKvlpvlNx2fdnw8E5wn45tSs_mZiSgoLhU8Cxg2jBg", "state"=>"eb30a2462d75546d28439534dcc560761a5eafefa5b47a75"}
2016-11-30T18:39:08.929944+00:00 app[web.1]:   Spree::UserAuthentication Load (1.2ms)  SELECT  "spree_user_authentications".* FROM "spree_user_authentications" WHERE "spree_user_authentications"."provider" = $1 AND "spree_user_authentications"."uid" = $2 LIMIT 1  [["provider", "facebook"], ["uid", "163770347430817"]]
2016-11-30T18:39:08.932153+00:00 app[web.1]:   Spree::User Load (1.2ms)  SELECT  "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."email" IS NULL LIMIT 1
2016-11-30T18:39:08.935508+00:00 app[web.1]:    (1.0ms)  BEGIN
2016-11-30T18:39:08.937492+00:00 app[web.1]:    (0.9ms)  ROLLBACK
2016-11-30T18:39:08.938440+00:00 app[web.1]: Redirected to http://MYSUB.DOMAIN.com/user/spree_user/sign_up
2016-11-30T18:39:08.938569+00:00 app[web.1]: Completed 302 Found in 11ms (ActiveRecord: 4.2ms)
PKul
  • 1,691
  • 2
  • 21
  • 41

1 Answers1

1

I had the same problem - I was getting that "One more step to complete your registration from Facebook" message. Turns out it was because I added a couple of fields to my Spree::User model, and I was validating that they were present (validates :first_name, :last_name, presence: true). The default spree-social code only populates the email address, and then it tries to save the user. It fails (since it didn't populate the first_name and last_name), so it displays that message. I commented out my validation line, and it all works. Now I need to figure out how to get the first_name and last_name back from Facebook so I can fill them in, and then uncomment my validation line.

I hope this helps somebody.