Authentication #170

Merged
bones7242 merged 43 commits from authentication into master 2017-09-29 02:29:22 +02:00
2 changed files with 22 additions and 1 deletions
Showing only changes of commit 959f57ffc5 - Show all commits

18
helpers/configVarCheck.js Normal file
View file

@ -0,0 +1,18 @@
const config = require('config');
const logger = require('winston');
module.exports = function () {
let configVars = [];
configVars.push(config.get('Logging'));
configVars.push(config.get('Database'));
configVars.push(config.get('AnalyticsConfig'));
configVars.push(config.get('WalletConfig'));
for (let i = 0; i < configVars.length; i++) {
for (let key in configVars[i]) {
if (configVars[i].hasOwnProperty(key)) {
logger.debug(`CONFIG CHECK: ${key} === ${configVars[i][key]}`);
}
}
}
};

View file

@ -20,6 +20,9 @@ const logLevel = config.get('Logging.LogLevel');
require('./config/loggerConfig.js')(logger, logLevel);
require('./config/slackLoggerConfig.js')(logger);
// check for global config variables
require('./helpers/configVarCheck.js')();
// trust the proxy to get ip address for us
app.enable('trust proxy');
@ -68,7 +71,7 @@ const hbs = expressHandlebars.create({
app.engine('handlebars', hbs.engine);
app.set('view engine', 'handlebars');
// middleware to pass user info back to client, if user is logged in
// middleware to pass user info back to client (for handlebars access), if user is logged in
app.use((req, res, next) => {
if (req.user) {
res.locals.user = {