Get all active tokens
(self)
| 1080 | } |
| 1081 | |
| 1082 | async def get_active_tokens(self) -> List[Token]: |
| 1083 | """Get all active tokens""" |
| 1084 | async with self._connect() as db: |
| 1085 | db.row_factory = aiosqlite.Row |
| 1086 | cursor = await db.execute("SELECT * FROM tokens WHERE is_active = 1 ORDER BY last_used_at ASC") |
| 1087 | rows = await cursor.fetchall() |
| 1088 | return [Token(**dict(row)) for row in rows] |
| 1089 | |
| 1090 | async def update_token(self, token_id: int, **kwargs): |
| 1091 | """Update token fields""" |