warn on failed login

This commit is contained in:
Balázs Kovács 2018-07-29 01:38:29 +02:00
parent 206e7a5b52
commit 4bd1e994b2

View file

@ -60,6 +60,7 @@ module.exports.login = (req, res, next) => {
return next(err);
}
if (!user) {
log.warn('auth', `[client ${req.ip}] authentication failure`);
req.flash('danger', info && info.message || _('Failed to authenticate user'));
return res.redirect('/users/login' + (req.body.next ? '?next=' + encodeURIComponent(req.body.next) : ''));
}