From 8efa24edce5e97ec3257df00b805070d20cbc41e Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Mon, 11 Dec 2023 19:36:35 +0100 Subject: [PATCH] align commands to secret storage --- lib/providers/secret_storage.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/providers/secret_storage.dart b/lib/providers/secret_storage.dart index 077d1cd..b74d515 100644 --- a/lib/providers/secret_storage.dart +++ b/lib/providers/secret_storage.dart @@ -41,8 +41,10 @@ abstract class SecretStorage { Future delete(String key); /// Write [value] at [key] in storage. + /// + /// Throws [SecretStorageException] if no password exist in storage to compare with. /// - /// Throws [SecretStorageException] if [kIsWeb] and neither [setPassword] or [unlock] has been called then [SecretStorageError.encryptedBoxNotOpened] + /// If [kIsWeb] and neither [setPassword] or [unlock] has been called then [SecretStorageError.encryptedBoxNotOpened] /// is returned in exception. Future set(String key, String value); @@ -87,7 +89,8 @@ class MobileSecretStorage extends SecretStorage { @override Future set(String key, String value) async { - return storage.write(key: key, value: value); + await _validatePasswordPresent(); + return await storage.write(key: key, value: value); } @override