File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -58,25 +58,21 @@ class StoredCryptoStore extends AsyncNotifier<CryptoStore?> {
58
58
throw Exception ('Password mismatch.' );
59
59
}
60
60
}
61
+ Future <void > saveCryptoStoreOnLocalStorage () async => await SimpleSecureStorage .write (_kPasswordDerivedKeyKey, base64.encode (await newCryptoStore! .key.exportRawKey ()));
62
+ await salt.saveToLocalStorage ();
61
63
if (checkSettings) {
62
- await salt.saveToLocalStorage ();
63
64
AppUnlockMethod unlockMethod = await ref.read (appUnlockMethodSettingsEntryProvider.future);
64
65
if (unlockMethod is MasterPasswordAppUnlockMethod ) {
65
66
await ref.read (passwordSignatureVerificationMethodProvider.notifier).enable (newPassword);
67
+ } else {
68
+ await saveCryptoStoreOnLocalStorage ();
66
69
}
67
70
} else {
68
- _saveOnLocalStorage (newCryptoStore );
71
+ await saveCryptoStoreOnLocalStorage ( );
69
72
}
70
73
use (newCryptoStore);
71
74
return newCryptoStore;
72
75
}
73
-
74
- /// Saves the [cryptoStore] on disk.
75
- Future <CryptoStore > _saveOnLocalStorage (CryptoStore cryptoStore) async {
76
- await cryptoStore.salt.saveToLocalStorage ();
77
- await SimpleSecureStorage .write (_kPasswordDerivedKeyKey, base64.encode (await cryptoStore.key.exportRawKey ()));
78
- return cryptoStore;
79
- }
80
76
}
81
77
82
78
/// Allows to encrypt some data according to a key.
You can’t perform that action at this time.
0 commit comments