feat(): migrate to auth identity

This commit is contained in:
doas root
2025-11-18 00:25:24 +03:00
parent 63a057b020
commit f44e688662
18 changed files with 219 additions and 48 deletions
@@ -1,6 +1,6 @@
from typing import cast, override
from typing import override
from sqlalchemy import exists, select
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from template_project.adapters.data_gateways.tables import user_table
@@ -17,12 +17,3 @@ class DefaultUserDataGateway(UserDataGateway):
statement = select(User).where(user_table.c.id == id_)
result = await self._session.execute(statement)
return result.scalar_one_or_none()
@override
async def exists_by_email(self, email: str) -> bool:
statement = select(exists(select(user_table).where(user_table.c.email == email)))
result = await self._session.execute(statement)
result_fetchone = result.fetchone()
if result_fetchone is None:
return False
return cast(bool, result_fetchone[0])