diff --git a/cptr/models/users.py b/cptr/models/users.py index 514064a..e14ac72 100644 --- a/cptr/models/users.py +++ b/cptr/models/users.py @@ -145,6 +145,12 @@ class Auth(Base): ) return result.scalar_one_or_none() + @staticmethod + async def get_by_user_id(user_id: str) -> Auth | None: + async with await get_db() as db: + result = await db.execute(select(Auth).where(Auth.user_id == user_id)) + return result.scalar_one_or_none() + @staticmethod async def username_exists(username: str) -> bool: async with await get_db() as db: