mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 17:26:46 +00:00
feat(tokens-repo): recovery key creation
This commit is contained in:
parent
8dfb3eb936
commit
eba1d01b3d
|
@ -64,7 +64,9 @@ class RedisTokensRepository(AbstractTokensRepository):
|
||||||
uses_left: Optional[int],
|
uses_left: Optional[int],
|
||||||
) -> RecoveryKey:
|
) -> RecoveryKey:
|
||||||
"""Create the recovery key"""
|
"""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:
|
def get_new_device_key(self) -> NewDeviceKey:
|
||||||
"""Creates and returns the new device key"""
|
"""Creates and returns the new device key"""
|
||||||
|
|
Loading…
Reference in a new issue