Modify logging of IP on failed login

This commit is contained in:
Timo Kössler 2024-01-17 13:54:06 +01:00
parent bfbe059505
commit 6bf1aa7f66
No known key found for this signature in database
GPG Key ID: 673552F90BE6828D

View File

@ -19,7 +19,6 @@ import { ROLES } from 'lib/constants';
import { getIpAddress } from 'lib/detect'; import { getIpAddress } from 'lib/detect';
const log = debug('umami:auth'); const log = debug('umami:auth');
const logFailed = debug('umami:auth:failed');
export interface LoginRequestBody { export interface LoginRequestBody {
username: string; username: string;
@ -69,8 +68,7 @@ export default async (
}); });
} }
log('Login failed:', { username, user }); log(`Login from ip ${getIpAddress(req)} with username "${username.replace(/["\r\n]/g, '')}" failed.`);
logFailed(`Login from ip ${getIpAddress(req)} failed.`);
return unauthorized(res, 'message.incorrect-username-password'); return unauthorized(res, 'message.incorrect-username-password');
} }