node js authentication for beginners code example
Example 1: passport js
$ npm install passport-google-oauth20
Example 2: passportjs mac req.user not saved
app.post('/login', passport.authenticate('local-login', { failureRedirect: '/login'}),
function(req, res) {
console.log(req.user);
req.session.user = req.user;
res.redirect('/users');
}
);