feat(logging): hash IP addresses in logs and Sentry integration

- Implemented IP hashing using SHA256 in logs for enhanced privacy.
- Updated Sentry integration to hash IP addresses before sending events.
- Enhanced `AllExceptionsFilter` and `crawler-detection.middleware` to use hashed IPs in logs and error handling.
- Refined request logging in `auth.service` to include hashed email instead of plain text email.
This commit is contained in:
Mathis HERRIOT
2026-02-09 11:05:53 +01:00
parent 378c41ddb2
commit 0706c47a33
5 changed files with 124 additions and 10 deletions

View File

@@ -103,10 +103,9 @@ export class AuthService {
}
async login(dto: LoginDto, userAgent?: string, ip?: string) {
this.logger.log(`Login attempt for email: ${dto.email}`);
const emailHash = await this.hashingService.hashEmail(dto.email);
this.logger.log(`Login attempt for email hash: ${emailHash}`);
const { email, password } = dto;
const emailHash = await this.hashingService.hashEmail(email);
const user = await this.usersService.findByEmailHash(emailHash);
if (!user) {