Included specific member props in theme service

no-issue

This simplifies the @member prop in themes, and includes a subscribed
property
This commit is contained in:
Fabien O'Carroll 2019-09-10 17:22:38 +08:00
parent 00604bf522
commit e881caab76

View File

@ -78,9 +78,14 @@ function updateLocalTemplateOptions(req, res, next) {
url: urlUtils.urlFor('home', {secure: req.secure, trailingSlash: false}, true)
};
const member = req.member ? {
email: req.member.email,
subscribed: req.member.plans.length !== 0
} : null;
hbs.updateLocalTemplateOptions(res.locals, _.merge({}, localTemplateOptions, {
data: {
member: req.member,
member: member,
site: siteData,
blog: siteData
}