Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function(err,results){
if (err!=null) {
// alert("Key Error!");
console.log(err);
console.log(results);
res.redirect("/");
} else {
console.log(results);
session = req.session;
session.login = true;
res.render('blockchain',{cargo:results});
}
});
} else {
app.get('/blockchain', function(req, res) {
session = req.session;
if (!session.login) {
res.redirect('/');
}
res.render('blockchain', { cargo : data
});
});