aimedb: add last login time update to register endpoints

This commit is contained in:
Hay1tsme 2024-02-12 15:58:02 -05:00
parent 4149944d56
commit 89c2b324dc

View File

@ -192,6 +192,7 @@ class AimedbServlette():
f"access_code {req.access_code} -> user_id {ret.user_id}"
)
if user_id and user_id > 0:
await self.data.card.update_card_last_login(req.access_code)
return ret
@ -222,6 +223,7 @@ class AimedbServlette():
self.logger.debug(f"Generated auth token {auth_key}")
ret.auth_key = auth_key_full
if user_id and user_id > 0:
await self.data.card.update_card_last_login(req.access_code)
return ret
@ -271,6 +273,8 @@ class AimedbServlette():
f"Registration blocked!: access code {ac} (IDm: {req.idm} PMm: {req.pmm})"
)
if user_id > 0:
await self.data.card.update_card_last_login(ac)
return ADBFelicaLookupResponse.from_req(req.head, ac)
async def handle_felica_lookup_ex(self, data: bytes, resp_code: int) -> bytes:
@ -295,7 +299,7 @@ class AimedbServlette():
self.logger.debug(f"Generated auth token {auth_key}")
resp.auth_key = auth_key_full
if user_id and user_id > 0:
await self.data.card.update_card_last_login(access_code)
return resp
@ -338,6 +342,9 @@ class AimedbServlette():
if resp.user_id <= 0:
resp.head.status = ADBStatus.BAN_SYS # Closest we can get to a "You cannot register"
else:
await self.data.card.update_card_last_login(req.access_code)
return resp
# TODO: Save these in some capacity, as deemed relevant