我正在使用Discover Meteor并使用accounts-twitter而非account-password。
添加帖子时,author
是使用user.username
设置的,但这不适用于accounts-twitter。
如何访问Twitter句柄以设置作者?
我已经尝试了user.services.twitter.screenName
,但这没有做任何事。
答案 0 :(得分:0)
原来这个问题与出版物有关。
请务必包含以下内容,以便在客户端中访问Twitter个人资料信息。
在服务器上:
Meteor.publish("userData", function () {
return Meteor.users.find({_id: this.userId},
{fields: {'services.twitter': 1}});
});
并且,在客户端:
Meteor.subscribe('userData');