We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ad5dc4e + dc1925d commit b51b42aCopy full SHA for b51b42a
1 file changed
lib/model/crypto.dart
@@ -24,11 +24,17 @@ class StoredCryptoStore extends AsyncNotifier<CryptoStore?> {
24
@override
25
FutureOr<CryptoStore?> build() async {
26
Salt? salt = await Salt.readFromLocalStorage();
27
- if (salt == null || !await SimpleSecureStorage.has(_kPasswordDerivedKeyKey)) {
+ if (salt == null) {
28
return null;
29
}
30
+
31
+ String? derivedKey = await SimpleSecureStorage.read(_kPasswordDerivedKeyKey);
32
+ if (derivedKey == null) {
33
+ return null;
34
+ }
35
36
return CryptoStore._(
- key: await AesGcmSecretKey.importRawKey(base64.decode((await SimpleSecureStorage.read(_kPasswordDerivedKeyKey))!)),
37
+ key: await AesGcmSecretKey.importRawKey(base64.decode(derivedKey)),
38
salt: salt,
39
);
40
0 commit comments