خرید بک لینک

Vote count: 0

I'm trying to automatically get the user's profile picture when authenticating their Facebook

addFacebookInformationToProfile() {
    if (Meteor.isServer) {
      // This will only merge in information the first time, then ignore it once the flag is true
      const user = Meteor.user();
      let useame = slugify(user.services.facebook.name, '');
      let i = 1;
      while (Meteor.users.findOne({useame})) {
        useame = slugify(user.services.facebook.name, '') + '' + i;
        i++;
      }
      Meteor.users.update({ _id: Meteor.userId(), 'profile.facebook': { $ne:true }}, {
        $set: {
          'profile.email': user.services.facebook.email,
          'profile.name': user.services.facebook.name,
          'useame': useame,
          'profile.gender': user.services.facebook.gender,
          'profile.facebook': true
        }
      });
    }
  }

What I have tried is under the

'profile.gender' line I put

'profile.picture': "http://graph.facebook.com/" + user.services.facebook.id + "/picture/?type=large",

I've also tried 'profile.picture': user.services.facebook.picture,

Both to no avail, what could show take place after 'profile.picture':

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 25 ارديبهشت 1395 ساعت: 5:58

صفحه بندی