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

even if device name exists
pull/26/head
Houkime 2022-12-14 17:41:47 +00:00
parent 95e200bfc5
commit bf6c230ae0
1 changed files with 2 additions and 0 deletions

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):