How do I REconfigure Meteor's accounts-facebook, or where is Meteor's Facebook configuration?

后端 未结 6 1570
灰色年华
灰色年华 2021-01-30 14:59

Meteor\'s accounts-facebook package was very easy to set up. To input the Facebook app ID and secret token, I loaded my meteor web app in a browser, and clicked on

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 15:36

    This will simply delete all services at startup and reinsert them based upon your settings.json (meteor --settings settings.json) Coffee-script equivalent:

    @privateSettings = Meteor.settings.private
    
    for s in privateSettings.services
      ServiceConfiguration.configurations.remove service: s.service
      ServiceConfiguration.configurations.insert s
    

    Settings stored in settings.json:

    {
      "private": {
        "services": [{
            "service": "google",
            "clientId": "yourappid.apps.googleusercontent.com",
            "secret": "yoursecret"
        },{ 
            "service": "twitter",
            "consumerKey": "yourconsumerkey",
            "secret": "yoursecret"
        },{
            "service": "facebook",
            "appId": "yourappid",
            "secret": "yoursecret"
        }],
      }
    }
    

提交回复
热议问题