some-fixes-chats

This commit is contained in:
2022-11-23 12:57:58 +03:00
parent 5ecb0d811b
commit 2cb152bdb1
7 changed files with 36 additions and 16 deletions

View File

@@ -36,11 +36,13 @@ class TokenStorage:
@staticmethod
async def revoke(token: str) -> bool:
payload = None
try:
print("[auth.tokenstorage] revoke token")
payload = JWTCodec.decode(token)
except: # noqa
pass
else:
finally:
await redis.execute("DEL", f"{payload.user_id}-{token}")
return True