如何获取 accounts-github 包中的用户名
How to get the username in the accounts-github package
我的应用程序中有一个用户(我自己)并且正在使用 accounts-github
包。
当我 运行 Meteor.users.find({}).fetch()
我看到这个:
[ { _id: 'fX7DZvFAe6KC9QvE8',
services: { resume: [Object] },
status: { online: true, lastLogin: [Object], idle: false } } ]
如果这包括用户名,那就太好了。有人知道这怎么可能吗?
问题是我在我的应用程序的其他地方调用了 Accounts.onCreateUser
,它 覆盖了 默认函数,其中一部分是设置用户的配置文件。
为了解决这个问题,我在 onCreateUser
中添加了以下内容:
Object.assign user,
profile: options.profile || {}
另请参阅此处的评论:https://github.com/meteor/docs/issues/81
我的应用程序中有一个用户(我自己)并且正在使用 accounts-github
包。
当我 运行 Meteor.users.find({}).fetch()
我看到这个:
[ { _id: 'fX7DZvFAe6KC9QvE8',
services: { resume: [Object] },
status: { online: true, lastLogin: [Object], idle: false } } ]
如果这包括用户名,那就太好了。有人知道这怎么可能吗?
问题是我在我的应用程序的其他地方调用了 Accounts.onCreateUser
,它 覆盖了 默认函数,其中一部分是设置用户的配置文件。
为了解决这个问题,我在 onCreateUser
中添加了以下内容:
Object.assign user,
profile: options.profile || {}
另请参阅此处的评论:https://github.com/meteor/docs/issues/81