fix(auth): prevent duplicate phone numbers when updating user profiles #33

Merged
amit merged 2 commits from fix/prevent-duplicate-profile-phone into main 2026-11-17 05:06:03 +00:00
1 changed files with 1 additions and 2 deletions
Showing only changes of commit 2812dc0ac7 - Show all commits

View File

@ -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)
)