我想连接到远程服务器并将其用于登录。这并不是特别困难。在远程和本地连接上使用一个用户
Remote = DDP.connect('http://somesite.com');
Accounts.connection = Remote;
Meteor.users = new Mongo.Collection('users', Remote);
然而,当我呼吁我的本地代码流星方法(有多个服务器,但是一次登录),它不能识别用户。
Meteor.methods({
'start': function() {
if (!this.userId) {
// ...
} else {
throw new Meteor.Error(401, 'Unauthorized');
}
}
});
这总是导致一个错误,尽管被登录。
如何将我的本地用户设置为相同的用户远程用户?