Refactor decrypt_data error handling

This commit is contained in:
thePR0M3TH3AN
2025-08-04 13:10:49 -04:00
parent 054ffd3383
commit 4d7f28b400
5 changed files with 104 additions and 56 deletions

View File

@@ -148,7 +148,9 @@ class VaultService:
"""Restore a profile from ``data`` and sync."""
with self._lock:
decrypted = self._manager.vault.encryption_manager.decrypt_data(data)
decrypted = self._manager.vault.encryption_manager.decrypt_data(
data, context="profile"
)
index = json.loads(decrypted.decode("utf-8"))
self._manager.vault.save_index(index)
self._manager.sync_vault()