sails.js - SailsJS: Transferring Facebook app secret to local.js file -


I am using PAL + passport for Facebook authentication in my app.

I have a middleware file that includes:

  module.exports = {express: {customMiddleware: function (app) {passport.use (New FacebookStrategy ({ ClientID: "123456", Customer customer: "123456", callbackURL: "http://myskills.co/auth/facebook/callback", passReqToCallback: true},   

Since the app is open Therefore, I do not want to expose the customer's client GitHub.
Sales documentation recommends using a local.js file which is ignored by git.

Let me know this Did not find the local How can this function be returned from the file?
Any help will be highly appreciated.

The complete code is on GitHub:

local.js is being loaded after all other config files, you might be using your clientID postprice = itemprop = "text" From Sails.config to config / passport.js via / code> and clientSecret . But simultaneously, the solution can also be simple: because both files are in the same folder, all you need is your local.js and you can get the required values. Something like this:
  ... var sm = need ('sitemap'); Var local = required ('./ local'); ... passport.He (new Facebook spreadsheet ({client ID: local. Facebook.clientIDididid, client secret: local.facebookclicksclick, callback URL: "http://dev.myskills.co/auth/facebook/callback", Pass-RTOllback: true}, ...    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -