Obsoleting some old files
Transition to SPA-style client Basis for Mosaico template editor
This commit is contained in:
parent
7750232716
commit
c85f2d4440
942 changed files with 86311 additions and 967 deletions
|
@ -21,6 +21,7 @@ async function getAuthenticatedConfig(context) {
|
|||
defaultCustomFormValues: await forms.getDefaultCustomFormValues(),
|
||||
user: {
|
||||
id: context.user.id,
|
||||
username: context.user.username,
|
||||
namespace: context.user.namespace
|
||||
},
|
||||
globalPermissions: shares.getGlobalPermissions(context),
|
||||
|
@ -28,24 +29,8 @@ async function getAuthenticatedConfig(context) {
|
|||
}
|
||||
}
|
||||
|
||||
function registerRootRoute(router, entryPoint, title) {
|
||||
router.getAsync('/*', passport.csrfProtection, async (req, res) => {
|
||||
const mailtrainConfig = await getAnonymousConfig(req.context);
|
||||
if (req.user) {
|
||||
Object.assign(mailtrainConfig, await getAuthenticatedConfig(req.context));
|
||||
}
|
||||
|
||||
res.render('react-root', {
|
||||
title,
|
||||
reactEntryPoint: entryPoint,
|
||||
reactCsrfToken: req.csrfToken(),
|
||||
mailtrainConfig: JSON.stringify(mailtrainConfig)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
registerRootRoute,
|
||||
getAuthenticatedConfig
|
||||
getAuthenticatedConfig,
|
||||
getAnonymousConfig
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue