Merge pull request #2473 from timokoessler/dev

Log IP address on failed login attempts
This commit is contained in:
Mike Cao authored and GitHub committed 2024-01-17 14:52:40 -08:00
commit 2552e1d495
1 file changed
+2 -1
+2 -1
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');
}