mirror of
https://github.com/librekeys/picoforge.git
synced 2026-07-28 08:01:19 -07:00
Fallback to fido::read_device_details when rescue::read_device_details fails
This commit is contained in:
@@ -319,5 +319,6 @@ pub fn read_device_details() -> Result<FullDeviceStatus, PFError> {
|
||||
config,
|
||||
secure_boot: false,
|
||||
secure_lock: false,
|
||||
method: "FIDO".to_string(),
|
||||
})
|
||||
}
|
||||
|
||||
+7
-2
@@ -3,8 +3,13 @@ use crate::{error::PFError, fido, rescue, types::*};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_device_details() -> Result<FullDeviceStatus, PFError> {
|
||||
rescue::read_device_details()
|
||||
// fido::read_device_details()
|
||||
match rescue::read_device_details() {
|
||||
Ok(status) => Ok(status),
|
||||
Err(e) => {
|
||||
log::warn!("Rescue method failed: {}. Falling back to FIDO...", e);
|
||||
fido::read_device_details()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -235,6 +235,7 @@ pub fn read_device_details() -> Result<FullDeviceStatus, PFError> {
|
||||
config,
|
||||
secure_boot: sb_enabled,
|
||||
secure_lock: sb_locked,
|
||||
method: "Rescue".to_string(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ pub struct FullDeviceStatus {
|
||||
pub config: AppConfig,
|
||||
pub secure_boot: bool,
|
||||
pub secure_lock: bool,
|
||||
pub method: String,
|
||||
}
|
||||
|
||||
// Fido stuff:
|
||||
|
||||
Reference in New Issue
Block a user