mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 01:33:22 +00:00
wip: Early exit for GetLockStatus if client isn't open
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -226,6 +226,10 @@ impl PluginAuthenticator for BitwardenPluginAuthenticator {
|
||||
}
|
||||
|
||||
fn lock_status(&self) -> Result<PluginLockStatus, Box<dyn std::error::Error>> {
|
||||
// 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 {
|
||||
|
||||
Reference in New Issue
Block a user