From 6bf1aa7f66b7bf0ae193a04d6a0dcf3725f3b5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Wed, 17 Jan 2024 13:54:06 +0100 Subject: [PATCH] Modify logging of IP on failed login --- src/pages/api/auth/login.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/api/auth/login.ts b/src/pages/api/auth/login.ts index 6dba9faa..00cb09d1 100644 --- a/src/pages/api/auth/login.ts +++ b/src/pages/api/auth/login.ts @@ -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'); }