Meteor.loginWithFacebook不能正常工作?

时间:2013-03-11 14:36:30

标签: oauth meteor facebook-oauth

添加了 accounts-facebook 套餐。我试图按照文档登录Facebook:http://docs.meteor.com/#meteor_loginwithexternalservice

拥有按钮点击事件

Meteor.loginWithFacebook({ requestPermissions: ['email']},
function (error) {
    if (error) {
        return console.log(error);
    }
});

服务器上的此设置

Accounts.loginServiceConfiguration.remove({
    service: "facebook"
});
Accounts.loginServiceConfiguration.insert({
    service: "facebook",
    clientId: "389711236782370",
    secret: "2wwd9c47589e3eb19e7dbgfb235b6a12"
});

我在facebook登录弹出窗口中收到未定义的client_id https://www.facebook.com/dialog/oauth?client_id=undefined&redirect_uri=http://localhost:3000/_oauth/facebook?close ...

即使我使用Meteor生成的{{loginButtons}},我也会得到相同的结果。我还添加了谷歌包,它的工作完美。谢谢你的帮助。

1 个答案:

答案 0 :(得分:20)

clientId 更改为 appId 有效!

Accounts.loginServiceConfiguration.remove({
    service: "facebook"
});
Accounts.loginServiceConfiguration.insert({
    service: "facebook",
    appId: ".........",
    secret: "........."
});

感谢评论中的middle8media:http://www.eventedmind.com/posts/meteor-customizing-login