使用Facebook登录时未填写个人资料

Profile Not Filling When Signing In With Facebook

本文关键字:个人资料 Facebook 登录 使用      更新时间:2023-09-26

在我的MeteorJs应用程序中,当他们使用Facebook登录时,你可以使用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 username = slugify(user.services.facebook.name, '');
      let i = 1;
      while (Meteor.users.findOne({username})) {
        username = 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,
          'username': username,
          'profile.gender': user.services.facebook.gender,
          'profile.picture': "https://graph.facebook.com/" + user.services.facebook.id + "/picture/?width=150&height=150",
          'profile.facebook': true
        }
      });
    }
  },

当我console.log个人资料图片行时,我会得到一个url,当在浏览器中输入时,它会显示Facebook用户的个人资料图片。

例如:(http://graph.facebook.com/100004071683764/picture/?width=150&高度=150)

这就是它在实际应用程序中的显示方式:(https://www.dropbox.com/s/6n1svdq56x6ctx8/Screenshot%202016-05-13%2017.24.06.png?dl=0)

如何在上面的圆圈中显示用户的个人资料图片,而不是圆圈周围的灰色框。

背景:

我们正在使用imgix和s3来获取我们的数据。

该应用程序托管在relyphe.com

使用

 <img class="img-circle" > 

这将使您的个人资料图片显示在一个圆圈中。