diff --git a/selfprivacy_api/repositories/tokens/json_tokens_repository.py b/selfprivacy_api/repositories/tokens/json_tokens_repository.py index 5f04eea..6b656ff 100644 --- a/selfprivacy_api/repositories/tokens/json_tokens_repository.py +++ b/selfprivacy_api/repositories/tokens/json_tokens_repository.py @@ -210,7 +210,13 @@ class JsonTokensRepository(AbstractTokensRepository): self, mnemonic_phrase: str, device_name: str ) -> Token: """Use the mnemonic new device key""" - new_device_key = self.get_new_device_key() + + with WriteUserData(UserDataFiles.TOKENS) as tokens_file: + new_device_key = NewDeviceKey( + key=tokens_file["new_device"]["token"], + created_at=tokens_file["new_device"]["date"], + expires_at=tokens_file["new_device"]["expiration"], + ) if new_device_key is None: raise TokenNotFoundError("New device key not found!")