fix(auth): handle all PyJWT errors gracefully and enforce link code status checks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user