Meteor Login Service Not Configured

最后都变了- 提交于 2021-02-07 07:41:21

问题


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?


回答1:


The solution is in IronRouter:

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



回答2:


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



来源:https://stackoverflow.com/questions/30007486/meteor-login-service-not-configured

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!