From f05f781b5b0a46158bbf6f7bf4d119f1d9b97b7e Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Sun, 10 May 2026 03:00:08 -0500 Subject: [PATCH] Fix: Biometric Revision V1 --- src-tauri/src/commands/biometric.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/commands/biometric.rs b/src-tauri/src/commands/biometric.rs index 5853c56..1317e5d 100644 --- a/src-tauri/src/commands/biometric.rs +++ b/src-tauri/src/commands/biometric.rs @@ -47,12 +47,22 @@ mod windows_hello { } pub fn authenticate(reason: &str) -> Result<(), String> { - nudge_focus(5, 250); - let result = UserConsentVerifier::RequestVerificationAsync(&HSTRING::from(reason)) - .and_then(|op| { - nudge_focus(5, 250); - op.get() - }) + let reason = reason.to_owned(); + let (tx, rx) = std::sync::mpsc::channel(); + + std::thread::spawn(move || { + nudge_focus(5, 250); + let outcome = UserConsentVerifier::RequestVerificationAsync(&HSTRING::from(reason.as_str())) + .and_then(|op| { + nudge_focus(5, 250); + op.get() + }); + let _ = tx.send(outcome); + }); + + let result = rx + .recv() + .map_err(|e| format!("internalError:{e:?}"))? .map_err(|e| format!("internalError:{e:?}"))?; match result {