Diagnose biometric: show real error on retry, disable sensitiveTransaction, enable useErrorDialogs for reliable OS prompt

This commit is contained in:
cania
2026-08-13 10:45:53 +02:00
parent 300c22d481
commit 68a6af0a42
2 changed files with 25 additions and 6 deletions

View File

@@ -70,6 +70,22 @@ class _AuthScreenState extends State<AuthScreen> {
}
}
/// Manual retry via button: show the REAL error so we can diagnose
/// why the OS dialog didn't appear.
Future<void> _retryBiometric() async {
setState(() => _bioMsg = null);
final (ok, err) = await widget.auth.authenticateWithBiometrics();
if (!mounted) return;
if (ok) {
final email = await widget.auth.getEmail() ?? '';
_goToDashboard(email);
} else {
setState(() {
_bioMsg = 'Sidik jari gagal: ${err ?? "dibatalkan"}';
});
}
}
/// On open: if a valid session is present, go straight to Dashboard.
Future<void> _trySilentAuth() async {
final timeout = await widget.auth.getTimeoutMinutes();
@@ -173,10 +189,7 @@ class _AuthScreenState extends State<AuthScreen> {
_biometricAvailable &&
_biometricEnabled)
TextButton.icon(
onPressed: () {
setState(() => _bioMsg = null);
_promptBiometricOnOpen();
},
onPressed: _retryBiometric,
icon: const Icon(Icons.fingerprint),
label: const Text('Gunakan Sidik Jari'),
),