Meteor Facebook login (Meteor.loginWithFacebook) issue extracting public profile, email and user_friends


#1

Trying to get Meteor Facebook login to work. It functions fully in that it uses Facebook API and requests the correct permissions from the users account and then logs in successfully.

The problem is it doesn’t save the permission requested information even though its been approved and only the basic name and ID are available in Meteor.user().services.facebook. Is this code not working because it’s not saving the users details on login? I can’t find a resource that details how to save or extract the other data.

Simply trying to console log the data to see that it’s been extracted out of the Facebook user account on log in.

Within Meteor.isClient code:

Template.login.events({
'click #facebook-login': function(event) {
    Meteor.loginWithFacebook({ requestPermissions: ['email', 'public_profile', 'user_friends', 'user_likes']}, function(err){
        if (err) {
            throw new Meteor.Error("Facebook login failed");
        }
        console.log(Meteor.user().services.facebook.name);
        console.log(Meteor.user().services.facebook.id);
        console.log(Meteor.user().services.facebook.email);
        console.log(Meteor.user().services.facebook.gender);            
    });
},

'click #logout': function(event) {
    Meteor.logout(function(err){
        if (err) {
            throw new Meteor.Error("Logout failed");
        }
    });
}

The config code:

ServiceConfiguration.configurations.remove({
    service: 'facebook'
});
 
ServiceConfiguration.configurations.insert({
    service: 'facebook',
    appId: 'correctAppID',
    secret: 'correctSecret'
});

#2

Same issue.
Must be fairly new, since the function worked perfectly a few days ago.have you updated any plugins recently?

Cheers
C


#3

Found this:


#4

Forgot to update this post but yeh the problem is the new v2.4 API asks you to do another call if you want to get the same data now, I postd my code on overflow - http://stackoverflow.com/questions/31615540/meteor-facebook-login-meteor-loginwithfacebook-issue-extracting-public-profile