mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
some code cleanup
This commit is contained in:
parent
3c05baec28
commit
1e468176c1
1 changed files with 3 additions and 5 deletions
|
@ -106,14 +106,12 @@ abstract class AuthViewModelBase with Store {
|
|||
|
||||
@action
|
||||
Future<void> biometricAuth() async {
|
||||
final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication();
|
||||
|
||||
try {
|
||||
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate();
|
||||
if (!authenticated) {
|
||||
if (await _biometricAuth.canCheckBiometrics() && await _biometricAuth.isAuthenticated()) {
|
||||
state = ExecutedSuccessfullyState();
|
||||
} else {
|
||||
throw Exception('Biometric authentication failed');
|
||||
}
|
||||
state = ExecutedSuccessfullyState();
|
||||
} catch (e) {
|
||||
state = FailureState(e.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue