为什么我的Meteor用户对象中没有收到任何电子邮件地址?

时间:2014-10-29 03:03:47

标签: meteor meteor-accounts

我使用Meteor 1.0和accounts-google登录服务。

我请求这些权限

requestPermissions:
  google: [
    'https://www.googleapis.com/auth/calendar',
    'https://www.googleapis.com/auth/userinfo.profile'
  ]

成功登录后,当我在服务器上查看Mongo shell中的用户对象时,我在用户文档中的任何地方都看不到任何电子邮件。

我的印象是Meteor将存储用于在某处登录Google的任何电子邮件地址。

如何收到电子邮件?

2 个答案:

答案 0 :(得分:2)

显然我需要请求许可:

"https://www.googleapis.com/auth/userinfo.email"

现在可行。

答案 1 :(得分:1)

您是否已将电子邮件字段发布给客户?

if (Meteor.isServer) {

    Meteor.publish('', function () {
        if (this.userId)
            return Meteor.users.find({ _id: this.userId }, { fields: { services: false } });
        else
            return this.stop();
    });
}
相关问题