mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Log IP address on failed login attempts
This commit is contained in:
parent
70a9ba4efb
commit
bfbe059505
@ -16,8 +16,10 @@ 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');
|
||||
const logFailed = debug('umami:auth:failed');
|
||||
|
||||
export interface LoginRequestBody {
|
||||
username: string;
|
||||
@ -68,6 +70,7 @@ export default async (
|
||||
}
|
||||
|
||||
log('Login failed:', { username, user });
|
||||
logFailed(`Login from ip ${getIpAddress(req)} failed.`);
|
||||
|
||||
return unauthorized(res, 'message.incorrect-username-password');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user