I'm using passport-local and I wonder how can I make registered a user when he opens site? Also I followed this tutorial :
app.post('/register', passport.authenticate('local-signup', {
successRedirect: '/main',
failureRedirect: '/',
failureFlash: true
}));
app.post('/login', passport.authenticate('local-login', {
successRedirect: '/main',
failureRedirect: '/',
failureFlash: true
}));
app.get('/main', isLogin, function(req, res) { .... });