Merged emailvalidation social

Always do the specific cases at the beginning and default case at the end (without any conditions). I would rewrite the above as follows

if(req.session.passport.user) {
    res.redirect('/profile');
}

res.render('login.ejs', { message: req.flash('loginMessage') }); // load login view