Diagnose biometric: show real error on retry, disable sensitiveTransaction, enable useErrorDialogs for reliable OS prompt
This commit is contained in:
@@ -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'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user