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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user