From dc4acd672d3f358d764ef8f252417e07045d1314 Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Wed, 3 Dec 2025 10:16:21 -0600 Subject: [PATCH] wip: Early exit for GetLockStatus if client isn't open --- .../windows_plugin_authenticator/src/ipc2/mod.rs | 4 ++++ .../desktop_native/windows_plugin_authenticator/src/lib.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apps/desktop/desktop_native/windows_plugin_authenticator/src/ipc2/mod.rs b/apps/desktop/desktop_native/windows_plugin_authenticator/src/ipc2/mod.rs index 1cdb7c4b3a4..d1e3860c520 100644 --- a/apps/desktop/desktop_native/windows_plugin_authenticator/src/ipc2/mod.rs +++ b/apps/desktop/desktop_native/windows_plugin_authenticator/src/ipc2/mod.rs @@ -103,6 +103,10 @@ pub struct NativeStatus { const NO_CALLBACK_INDICATOR: u32 = 0; impl WindowsProviderClient { + pub fn is_available() -> bool { + desktop_core::ipc::path("af").exists() + } + // FIXME: Remove unwraps! They panic and terminate the whole application. #[allow(clippy::unwrap_used)] pub fn connect() -> Self { diff --git a/apps/desktop/desktop_native/windows_plugin_authenticator/src/lib.rs b/apps/desktop/desktop_native/windows_plugin_authenticator/src/lib.rs index 4a46c45af48..977c95dbb71 100644 --- a/apps/desktop/desktop_native/windows_plugin_authenticator/src/lib.rs +++ b/apps/desktop/desktop_native/windows_plugin_authenticator/src/lib.rs @@ -226,6 +226,10 @@ impl PluginAuthenticator for BitwardenPluginAuthenticator { } fn lock_status(&self) -> Result> { + // If the IPC pipe is not open, then the client is not open and must be locked/logged out. + if !WindowsProviderClient::is_available() { + return Ok(PluginLockStatus::PluginLocked); + } get_lock_status(&self.get_client()) .map(|response| { if response.is_unlocked {