Merge pull request #2473 from timokoessler/dev

Log IP address on failed login attempts
This commit is contained in:
Mike Cao 2024-01-17 14:52:40 -08:00 committed by GitHub
commit 2552e1d495
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@ import {
import { getUserByUsername } from 'queries';
import * as yup from 'yup';
import { ROLES } from 'lib/constants';
import { getIpAddress } from 'lib/detect';
const log = debug('umami:auth');
@ -67,7 +68,7 @@ export default async (
});
}
log('Login failed:', { username, user });
log(`Login from ip ${getIpAddress(req)} with username "${username.replace(/["\r\n]/g, '')}" failed.`);
return unauthorized(res, 'message.incorrect-username-password');
}