mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
version bump to 3.13.9, auth working on mac (#1367)
* version bump to 3.13.9, auth working on mac * bump flutter version in workflow file * workflow fix * test fix * downgrade flutter version * test fix * test fix * update gradle version * fixes for updated dart version, localization file updates * remove accidental inclusion * missed some unimplemented throws
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_authentication/flutter_local_authentication.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/view_model/auth_state.dart';
|
||||
@@ -105,16 +106,14 @@ abstract class AuthViewModelBase with Store {
|
||||
|
||||
@action
|
||||
Future<void> biometricAuth() async {
|
||||
final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication();
|
||||
|
||||
try {
|
||||
final canBiometricAuth = await _biometricAuth.canCheckBiometrics();
|
||||
|
||||
if (canBiometricAuth) {
|
||||
final isAuthenticated = await _biometricAuth.isAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
state = ExecutedSuccessfullyState();
|
||||
}
|
||||
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate();
|
||||
if (!authenticated) {
|
||||
throw Exception('Biometric authentication failed');
|
||||
}
|
||||
state = ExecutedSuccessfullyState();
|
||||
} catch (e) {
|
||||
state = FailureState(e.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user