简体   繁体   中英

Meteor Login Service Not Configured

I'm using Meteor.loginWithFacebook to give users access to my app. The code is

Meteor.loginWithFacebook({
    loginStyle:"redirect"
}, function(err){
    if (err) {
        throw err;
    }
    else{
        window.location = "/landing"
    }
});

My server has an accounts.js with the following:

ServiceConfiguration.configurations.remove({
  service: "facebook"
});
ServiceConfiguration.configurations.insert({
  service: "facebook",
  appId: "id",
  secret: "secret"
});

It works on desktop and has worked when bundled into cordova, yet suddenly, it does not work and presents me with the error that Login service not yet configured.

Uncaught Error: ServiceConfiguration.ConfigError: Login service configuration not yet loaded:2199: http://meteor.local/packages/blaze.js

I keep seeing Accounts.loginServicesConfigured() mentioned everywhere but do not see that explained in the docs and thus don't know how to use it.

Any help?

The solution is in IronRouter:

waitOn:function(){
    Accounts.loginServicesConfigured();
}

Check http://devdocs.io/meteor/ and search for Accounts.loginServicesConfigured . I believe you can use it on iron:router waitOn function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM