How to use the express-session.login function in express-session

To help you get started, we’ve selected a few express-session examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SummerTiger / bitmedi / sh_blockchain / server.js View on Github external
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 {
github SummerTiger / bitmedi / sh_blockchain / server.js View on Github external
app.get('/blockchain', function(req, res) {
	session = req.session;
	if (!session.login) {
	    res.redirect('/');
	}

        res.render('blockchain', { cargo : data

        });

    });