feat(tokens-repo): recovery key creation

pull/26/head
Houkime 2022-12-14 18:10:48 +00:00
parent 8dfb3eb936
commit eba1d01b3d
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,9 @@ class RedisTokensRepository(AbstractTokensRepository):
uses_left: Optional[int],
) -> RecoveryKey:
"""Create the recovery key"""
raise NotImplementedError
recovery_key = RecoveryKey.generate(expiration=expiration, uses_left=uses_left)
self._store_model_as_hash(RECOVERY_KEY_REDIS_KEY, recovery_key)
return recovery_key
def get_new_device_key(self) -> NewDeviceKey:
"""Creates and returns the new device key"""