fix(auth): enforce exact phone matching to prevent substring duplicate errors

This commit is contained in:
Urvish Prajapati 2026-11-16 16:13:04 +05:30
parent 8ae0d76847
commit 2812dc0ac7
1 changed files with 1 additions and 2 deletions

View File

@ -42,10 +42,9 @@ class AuthRepository:
self, self,
phone_number: str, phone_number: str,
) -> AppUser | None: ) -> AppUser | None:
# Preserves the existing auth API's LIKE lookup semantics.
result = await self._session.execute( result = await self._session.execute(
select(AppUser) select(AppUser)
.where(AppUser.phone_number.like(f"%{phone_number}%")) .where(AppUser.phone_number == phone_number)
.order_by(AppUser.id.asc()) .order_by(AppUser.id.asc())
.limit(1) .limit(1)
) )