Fallback to fido::read_device_details when rescue::read_device_details fails

This commit is contained in:
Fabrice Bellamy
2026-01-20 15:30:41 +01:00
parent 750d80b331
commit a6cfda1389
4 changed files with 10 additions and 2 deletions
+1
View File
@@ -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
View File
@@ -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]
+1
View File
@@ -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(),
})
}
+1
View File
@@ -55,6 +55,7 @@ pub struct FullDeviceStatus {
pub config: AppConfig,
pub secure_boot: bool,
pub secure_lock: bool,
pub method: String,
}
// Fido stuff: