Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.readFile(path.join(__dirname, '../views/auth_success.html'), 'utf8', (err, data) => {
if (err) {
console.error(err)
return res.redirect(redirectURL || '/');
}
let jsrender = require("jsrender");
jsrender.templates({ tmpl: data });
var html = jsrender.render.tmpl({
identityData: JSON.stringify(identityData)
})
res.writeHead(200, { "content-type": 'text/html' });
res.write(html);
res.end();
});
});
fs.readFile(path.join(__dirname, '../views/reset_email.html'), 'utf8', (err, data) => {
if (err) {
done(err);
}
let jsrender = require("jsrender");
jsrender.templates({ tmpl: data });
var html = jsrender.render.tmpl({
username: user.username,
host: req.headers.host,
token: token
})
done(null, html, user);
});
},