From 3d9883d3e4a7b0a73d936eff6871113685b631e8 Mon Sep 17 00:00:00 2001 From: cania Date: Thu, 13 Aug 2026 09:59:41 +0200 Subject: [PATCH] Biometric bypass on login: if enabled+registered, prompt fingerprint on open -> on success skip email/password. On fail, show grey msg and allow manual login via Masuk button --- lib/auth_screen.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/auth_screen.dart b/lib/auth_screen.dart index 1b6c6ca..a498c40 100644 --- a/lib/auth_screen.dart +++ b/lib/auth_screen.dart @@ -20,6 +20,7 @@ class _AuthScreenState extends State { bool _isLogin = true; bool _busy = false; String? _error; + String? _bioMsg; @override void initState() { @@ -53,8 +54,12 @@ class _AuthScreenState extends State { if (ok) { final email = await widget.auth.getEmail() ?? ''; _goToDashboard(email); + } else { + // fingerprint failed/cancelled -> let user login manually + setState(() { + _bioMsg = 'Gagal verifikasi sidik jari. Silakan masuk manual.'; + }); } - // on failure, the auth screen stays; user can tap Masuk manually } /// On open: if a valid session is present, go straight to Dashboard. @@ -140,6 +145,12 @@ class _AuthScreenState extends State { const SizedBox(height: 8), if (_error != null) Text(_error!, style: const TextStyle(color: Colors.red)), + if (_bioMsg != null) + Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Text(_bioMsg!, + style: const TextStyle(color: Colors.grey)), + ), const SizedBox(height: 12), _busy ? const CircularProgressIndicator()