mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
dcfb2b2b73
* bio auth mac fix * remove comment and change duration from 2 to 0 * cherry pick previous changes * fix empty string case * add support for path for all currency types * disable paths on electrum and monero nodes * undo mac auth changes * stuff I missed * 1 last thing * another thing I missed
32 lines
No EOL
775 B
Dart
32 lines
No EOL
775 B
Dart
import 'package:local_auth/local_auth.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
class BiometricAuth {
|
|
final _localAuth = LocalAuthentication();
|
|
|
|
Future<bool> isAuthenticated() async {
|
|
try {
|
|
return await _localAuth.authenticate(
|
|
localizedReason: S.current.biometric_auth_reason,
|
|
options: AuthenticationOptions(
|
|
biometricOnly: true,
|
|
useErrorDialogs: true,
|
|
stickyAuth: false));
|
|
} on PlatformException catch (e) {
|
|
print(e);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
Future<bool> canCheckBiometrics() async {
|
|
try {
|
|
return await _localAuth.canCheckBiometrics;
|
|
} on PlatformException catch (e) {
|
|
print(e);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
} |