Print failed login attempts to console

This commit is contained in:
Pavel Djundik 2018-03-17 10:09:59 +02:00
parent 4c0479fe3d
commit ed4b6e85ac

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;
}