From 786f7df7dd292bb737ba78ed8199b84401850ad4 Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Wed, 6 Nov 2024 16:27:49 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20erro=20na=20valida=C3=A7=C3=A3o=20de=20b?= =?UTF-8?q?iometria=20quando=20o=20usu=C3=A1rio=20fechava=20o=20modal=20de?= =?UTF-8?q?=20leitura=20biom=C3=A9trica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/qr_code_page/qr_code_page_widget.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index cb30c56f..d02e5f12 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -324,8 +324,9 @@ class _QrCodePageWidgetState extends State with TickerProvider Future _showBiometricsAuth(BuildContext context) async { await BiometricHelper.checkBiometrics() .then((value) async => await BiometricHelper.authenticateBiometric().then((value) async { - final key = - await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage) ?? ''; + if (value == false) throw Exception('Biometric authentication failed'); + final key = await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage); + if (key == null || key.isEmpty) throw Exception('No key found'); safeSetState(() { if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();