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