All about user login
Not runnable at the moment
This commit is contained in:
parent
fbb8f5799e
commit
d79bbad575
49 changed files with 1554 additions and 686 deletions
26
lib/client-helpers.js
Normal file
26
lib/client-helpers.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
const passport = require('./passport');
|
||||
|
||||
function _getConfig() {
|
||||
return {
|
||||
authMethod: passport.authMethod,
|
||||
isAuthMethodLocal: passport.isAuthMethodLocal
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue