Since, AFAIK, local.js
is being loaded after all other config files, you will probably not be able to access your clientID
and clientSecret
through Sails.config
from config/passport.js
. But at the same time, the solution can be even simpler: since both files are in the same folder, you can just require your local.js
and get the values you need. Something like that:
...
var sm = require('sitemap');
var locals = require('./local');
...
passport.use(new FacebookStrategy({
clientID: locals.facebook.clientID,
clientSecret: locals.facebook.clientSecret,
callbackURL: "http://dev.myskills.co/auth/facebook/callback",
passReqToCallback: true
},
...