fix(tokens-repo): raise token not found when deleting nonexistent token

even if device name exists
This commit is contained in:
Houkime 2022-12-14 17:41:47 +00:00
parent 95e200bfc5
commit bf6c230ae0

View file

@ -39,6 +39,8 @@ class RedisTokensRepository(AbstractTokensRepository):
"""Delete the token"""
r = self.connection
key = RedisTokensRepository._token_redis_key(input_token)
if input_token not in self.get_tokens():
raise TokenNotFound
r.delete(key)
def reset(self):