Social login with Facebook not saving email even if it's asking for that permission

Relevant line of code: https://github.com/nanote-io/nanote/blob/master/client/templates/welcomePage/welcomePage.js

Template.welcomePage.events({
  "click #login-with-facebook": function(e) {
    Meteor.loginWithFacebook({}, function(err){
      if (err) {
        throw new Meteor.Error("Facebook login failed");
      }
    });
  },
  "click #login-with-twitter": function(e) {
    Meteor.loginWithTwitter({}, function(err){
      if (err) {
        throw new Meteor.Error("Twitter login failed");
      }
    });
  },
  "click #login-with-google": function(e) {
    Meteor.loginWithGoogle({}, function(err){
      if (err) {
        throw new Meteor.Error("Google login failed");
      }
    });
  }
});

I can see it asking me for the email in the OAuth dialog, but the email is not being saved to the User record. Any ideas?

1 Like

(A message like brought me back here) - For would-be Googler’s: Looks like this answer can be found here: http://guide.meteor.com/accounts.html#supported-login-services


Meteor.loginWithFacebook(
  {
    requestPermissions: ['user_friends', 'public_profile', 'email']
  }, 
  function(err){
    if (err) {
      throw new Meteor.Error("Facebook login failed");
    }
  });
});