@nakedcreativity/cee-ms-node 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +14 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -21,6 +21,8 @@ function ceems(config) {
|
|
|
21
21
|
cache: true
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
this.config = config;
|
|
25
|
+
|
|
24
26
|
// register liquid engine
|
|
25
27
|
this.app.engine('liquid', this.engine.express({
|
|
26
28
|
strict_variables: false,
|
|
@@ -76,7 +78,7 @@ function ceems(config) {
|
|
|
76
78
|
|
|
77
79
|
// validate authorisation JWT here
|
|
78
80
|
this.site = JSON.parse(fs.readFileSync('./pages/site.json', 'utf8'));
|
|
79
|
-
console.log(req.body.page)
|
|
81
|
+
//console.log(req.body.page)
|
|
80
82
|
req.query.edit = true;
|
|
81
83
|
this.render(req,res, req.body.page);
|
|
82
84
|
|
|
@@ -127,6 +129,17 @@ ceems.prototype.render = function(req, res, page=null) {
|
|
|
127
129
|
})
|
|
128
130
|
}
|
|
129
131
|
|
|
132
|
+
// if there are whitelisted cookies, add these to the page so they can be rendered
|
|
133
|
+
if(this.config.whitelistedCookies){
|
|
134
|
+
page.cookies = []
|
|
135
|
+
_.each(this.config.whitelistedCookies, cookieName=>{
|
|
136
|
+
if(req.cookies[cookieName]){
|
|
137
|
+
page.cookies[cookieName] = req.cookies[cookieName]
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
130
143
|
var renderedRegions = {}
|
|
131
144
|
var jobs = []
|
|
132
145
|
|