Merge pull request #2247 from thelounge/xpaw/failed-login-log

Print failed login attempts to console
This commit is contained in:
Jérémie Astori 2018-03-18 11:14:00 -04:00 committed by GitHub
commit 1632ae27d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -624,6 +624,12 @@ function performAuthentication(data) {
const authCallback = (success) => {
// Authorization failed
if (!success) {
if (!client) {
log.warn(`Authentication for non existing user attempted from ${colors.bold(getClientIp(socket))}`);
} else {
log.warn(`Authentication failed for user ${colors.bold(data.user)} from ${colors.bold(getClientIp(socket))}`);
}
socket.emit("auth", {success: false});
return;
}