Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
configureExpress(app) {
app.engine('mustache', Mustache);
app.set('view options', {layout: false});
app.set('etag', 'strong');
app.use((req, res, next) => {
if (this.ieCompatMode) {
res.setHeader('X-UA-Compatible', `IE=${this.ieCompatMode}`);
}
next();
});
app.use(express.static(`${__dirname}/../../public`));
}
user.save().then(function() {
consolidate.mustache(
__dirname + "/../templates/email/reset_password.html",
{
username: username,
new_password: newpw
},
function(err, html)
{
if (err)
{
user.password = oldpw;
user.save().then(function() {
self.emitFailure(err);
}).error(function(e) {
self.emitFailure(e);
});
}
return new Promise((resolve, reject) => {
cons.mustache(
path.resolve(__dirname, '../views/emails/', filename),
data || {}, function(err, html) {
if (err) { return reject(err); }
resolve(html);
});
});
};