From 34a050847ee686df90cf1ff4e6d86c900447278f Mon Sep 17 00:00:00 2001 From: Noloquideus Date: Sun, 28 Jun 2026 14:12:24 +0300 Subject: [PATCH] fix: clean auth hashing and login message --- src/application/commands/user_login_start.py | 4 ++-- src/infrastructure/security/hash.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/application/commands/user_login_start.py b/src/application/commands/user_login_start.py index dd59ba1..cb97a05 100644 --- a/src/application/commands/user_login_start.py +++ b/src/application/commands/user_login_start.py @@ -42,8 +42,8 @@ class UserLoginStartCommand: exists = await self._unit_of_work.user_repository.exists_by_email(email) if not exists: - self._logger.info(f'Login failed: email already registered ({email})') - raise ApplicationException(404, 'Email registered') + self._logger.info(f'Login failed: email not registered ({email})') + raise ApplicationException(404, 'Email not registered') trace_id = trace_id_var.get() if not trace_id or trace_id == 'N/A': diff --git a/src/infrastructure/security/hash.py b/src/infrastructure/security/hash.py index 94d92b8..9f2c3c2 100644 --- a/src/infrastructure/security/hash.py +++ b/src/infrastructure/security/hash.py @@ -5,13 +5,11 @@ from src.application.contracts import IHashService, ILogger class HashService(IHashService): def __init__(self, logger: ILogger): - self._logger = logger + pass async def hash(self, value: str) -> str: hashed_value = bcrypt.hashpw(value.encode(), bcrypt.gensalt()) - self._logger.info(f'Hash value {hashed_value.decode()}') return hashed_value.decode() async def verify(self, hashed_value: str, plain_value: str) -> bool: - self._logger.info(f'Hash value {hashed_value[:10]}') return bcrypt.checkpw(plain_value.encode(), hashed_value.encode()) \ No newline at end of file