Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Modify logging of IP on failed login

Timo Kössler6bf1aa7f66b7
diff --git a/src/pages/api/auth/login.ts b/src/pages/api/auth/login.ts
index 6dba9faa0..00cb09d1d 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');
}