bio auth on mac + package updates for 3.19.3/5 (#1398)

* bio auth mac fix

* remove comment and change duration from 2 to 0

* cherry pick previous changes

* workaround for secure storage bug on mac

* bump version to 3.19.5 (because breez will need this version anyways)

* some code cleanup

* some changess didn't get saved

* just documenting the issue [skip ci]

* undo accidental removal + minor code cleanup

* merge conflicts

* Minor UI change [skip ci]

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Matthew Fosse
2024-05-06 22:55:05 +03:00
committed by GitHub
co-authored by Omar Hatem
parent 3f3cd10158
commit e5be737236
32 changed files with 730 additions and 555 deletions
+4 -8
View File
@@ -106,14 +106,10 @@ abstract class AuthViewModelBase with Store {
@action
Future<void> biometricAuth() async {
try {
final canBiometricAuth = await _biometricAuth.canCheckBiometrics();
if (canBiometricAuth) {
final isAuthenticated = await _biometricAuth.isAuthenticated();
if (isAuthenticated) {
state = ExecutedSuccessfullyState();
}
if (await _biometricAuth.canCheckBiometrics() && await _biometricAuth.isAuthenticated()) {
state = ExecutedSuccessfullyState();
} else {
throw Exception('Biometric authentication failed');
}
} catch (e) {
state = FailureState(e.toString());
@@ -1,3 +1,4 @@
import 'package:cake_wallet/core/secure_storage.dart';
import 'package:mobx/mobx.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:cake_wallet/entities/secret_store_key.dart';
@@ -37,8 +38,7 @@ abstract class EditBackupPasswordViewModelBase with Store {
@action
Future<void> save() async {
final key = generateStoreKeyFor(key: SecretStoreKey.backupPassword);
await secureStorage.delete(key: key);
await secureStorage.write(key: key, value: backupPassword);
await writeSecureStorage(secureStorage, key: key, value: backupPassword);
secretStore.write(key: key, value: backupPassword);
}
}