Social login comes with _id only (no .profile info)


#1

A few days ago this was working perfectly on my app, Facebook, Twitter and Google+. So, we asume all ID are the corrects ones.
I can login but I have no access to user info now, just to _id of user.

Today it wasn’t working and after a while I decided to start from scratch taking another ways.

We’re going to focus on Facebook login (all of them are kind of the same).

This is my account.js under server folder (I’ve created this file but it was working without it):

ServiceConfiguration.configurations.remove({
  service: "facebook"
});
ServiceConfiguration.configurations.insert({
  service: "facebook",
  appId: ID,
  secret: ID
});

In my controller:

Meteor.loginWithFacebook({
      requestPermissions: ['user_friends', 'public_profile', 'email'] // --> new stuff, was working before without this
    }, (err) => {
      if (err) {
        throw new Meteor.Error("Facebook login failed");
      } else {
        //var user = Meteor.user();
        //user.username = user.profile.name; --> this is just _id so I get an undefined issue
        //state.go('food');
      }
    });

Running Meteor.users.find().fetch() after login I only get this:

Object {_id: "CSRDT5WKSYMLaQnoY"}

Am I missing something?
Thanks in advance


#2

You need to publish the whole users document to read profile and also the services ( which contains facebook scoped ID and other fields you’re fetching). Or you can try enabling/adding autopublish to see if you’re receiving the information.


#3

Adding autopublish package I can’t see more info either.

The field published are ok, as I said it was working perfectly a few days ago.

The only thing I’ve changed was the root path, because I had to deploy my app, but I don’t think so because the url still being localhost.


#4

Are you using the mongoDB which comes packaged with Meteor? Can you check inside the collections if that data is there?