Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor.loginWithFacebook not working?

having added the accounts-facebook package. Im trying to login with facebook following the docs: http://docs.meteor.com/#meteor_loginwithexternalservice

Having this button click event:

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

And this setup on the server:

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

Im getting a undefined client_id in the facebook login pop-up: https://www.facebook.com/dialog/oauth?client_id=undefined&redirect_uri=http://localhost:3000/_oauth/facebook?close...

Even if I use the {{loginButtons}} generated by Meteor I get the same result. I have also added the google package and its working perfectly. Thanks for any help.

like image 665
Vindberg Avatar asked Mar 11 '13 14:03

Vindberg


1 Answers

Changing clientId to appId works!

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

Thanks to middle8media in comments: http://www.eventedmind.com/posts/meteor-customizing-login

like image 146
Vindberg Avatar answered Sep 30 '22 18:09

Vindberg