From 2812dc0ac774207d96899d30054fd4c7bd3a074e Mon Sep 17 00:00:00 2001 From: Urvish Date: Mon, 16 Nov 2026 16:13:04 +0530 Subject: [PATCH] fix(auth): enforce exact phone matching to prevent substring duplicate errors --- app/features/auth/repository.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/features/auth/repository.py b/app/features/auth/repository.py index 1693b31..475d564 100644 --- a/app/features/auth/repository.py +++ b/app/features/auth/repository.py @@ -42,10 +42,9 @@ class AuthRepository: self, phone_number: str, ) -> AppUser | None: - # Preserves the existing auth API's LIKE lookup semantics. result = await self._session.execute( select(AppUser) - .where(AppUser.phone_number.like(f"%{phone_number}%")) + .where(AppUser.phone_number == phone_number) .order_by(AppUser.id.asc()) .limit(1) )