Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook doesn't always return an email address, but Spree assumes it does. #164

Open
ghost opened this issue Jul 31, 2015 · 4 comments
Open

Comments

@ghost
Copy link

ghost commented Jul 31, 2015

In the apply_omniauth method we asssume we can get an email out of what FB returns. If there is not one perhaps we should throw an error so we can tell the user 'Hey, FB didn't provide your email, please use another method'
Right now the user just gets the 'one more step' error message which isn't that helpful.

@ghost
Copy link
Author

ghost commented Jul 31, 2015

Only seeing this on API 2.4, 2.0 seems to be fine.

@krzysiek1507
Copy link
Contributor

@tesserakt API 2.4 doesn't return email as default.

@habib136888
Copy link
Contributor

Any solutions for this. I dont see it returning email address for me. Where as other ecommerce site are saving my email.

@krzysiek1507
Copy link
Contributor

@habib136888 you can monkey patch method request_phase https://github.com/spree-contrib/spree_social/blob/3-0-stable/lib/spree_social/engine.rb

OmniAuth::Strategies::Facebook.class_eval do
  def request_phase
    options[:scope] ||= 'email'
    options[:info_fields] ||= 'name,email'
    options[:display] = mobile_request? ? 'touch' : 'page'
    super
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants