fix(auth): handle all PyJWT errors gracefully and enforce link code status checks

This commit is contained in:
2026-08-19 21:12:45 +07:00
parent 2e01b6502c
commit 77ef4aaa57
5 changed files with 22 additions and 5 deletions

View File

@@ -32,3 +32,10 @@ async def get_link_code_by_code(session: AsyncSession, code: str) -> LinkCode |
r = await session.execute(stmt)
return r.scalar_one_or_none()
async def use_link_code(session: AsyncSession, code: LinkCode) -> LinkCode:
code.status = LinkCodeStatus.USED
await session.commit()
return code