frontend: add username login

This commit is contained in:
2024-06-08 19:18:15 -04:00
parent 8e6e5ea903
commit 79f511c837
4 changed files with 17 additions and 9 deletions

View File

@ -121,7 +121,7 @@ class CardData(BaseData):
result = await self.execute(sql)
if result is None:
self.logger.warn(f"Failed to update last login time for {access_code}")
def to_access_code(self, luid: str) -> str:
"""
Given a felica cards internal 16 hex character luid, convert it to a 0-padded 20 digit access code as a string

View File

@ -120,3 +120,7 @@ class UserData(BaseData):
result = await self.execute(sql)
return result is not None
async def get_user_by_username(self, username: str) -> Optional[Row]:
result = await self.execute(aime_user.select(aime_user.c.username == username))
if result: return result.fetchone()