我正在尝试使用 2 台使用 DDP.connect 的服务器。 我的订阅运行良好,但使用 Meteor.call 调用的方法需要对用户进行身份验证。
如何将用户连接到远程服务器?
最佳答案
您可以通过这种方式进行身份验证:
var DDPConnection = DDP.connect(<url>);
DDPConnection.call("login", {
"password":"qwerty",
"user" : {
"email":"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f3969e929a9fb3969e929a9fdd909c9e" rel="noreferrer noopener nofollow">[email protected]</a>"
}
},
function(err,result) {
//Check result
}
);
看看我的另一个answer根据您拥有/想要使用的设置,使用不同的登录选项。
关于meteor - 使用Meteor,如何从远程服务器登录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22466522/