mailtrain/lib/client-helpers.js
Tomas Bures be7da791db LDAP auth seems to work too.
Users completely refactored to ReactJS and Knex
Initial draft of call context passing (for the time being only in users:remove
2017-07-08 21:34:26 +02:00

28 lines
679 B
JavaScript

'use strict';
const passport = require('./passport');
const config = require('config');
function _getConfig() {
return {
authMethod: passport.authMethod,
isAuthMethodLocal: passport.isAuthMethodLocal,
externalPasswordResetLink: config.ldap.passwordresetlink
}
}
function registerRootRoute(router, title, entryPoint) {
router.get('/*', passport.csrfProtection, (req, res) => {
res.render('react-root', {
title,
reactEntryPoint: entryPoint,
reactCsrfToken: req.csrfToken(),
mailtrainConfig: JSON.stringify(_getConfig())
});
});
}
module.exports = {
registerRootRoute
};