mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 18:00:17 +01:00
Modify logging of IP on failed login
This commit is contained in:
parent
bfbe059505
commit
6bf1aa7f66
@ -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');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user