Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
align commands to secret storage
Browse files Browse the repository at this point in the history
  • Loading branch information
schwartz-concordium committed Dec 11, 2023
1 parent e4772d1 commit 8efa24e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/providers/secret_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ abstract class SecretStorage {
Future<void> 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<void> set(String key, String value);

Expand Down Expand Up @@ -87,7 +89,8 @@ class MobileSecretStorage extends SecretStorage {

@override
Future<void> set(String key, String value) async {
return storage.write(key: key, value: value);
await _validatePasswordPresent();
return await storage.write(key: key, value: value);
}

@override
Expand Down

0 comments on commit 8efa24e

Please sign in to comment.