added flash messages to login route

This commit is contained in:
Sahat Yalkabov
2013-11-18 14:37:01 -05:00
parent 8322b40095
commit bdfec9f914
3 changed files with 8 additions and 4 deletions

View File

@ -56,7 +56,7 @@ exports.postlogin = function(req, res, next) {
passport.authenticate('local', function(err, user, info) {
if (err) return next(err);
if (!user) {
req.session.messages = [info.message];
req.flash('messages', [info.message]);
return res.redirect('/login');
}
req.logIn(user, function(err) {