mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-16 04:56:18 +00:00
trust this device to skip 2fa (#9012)
* trust this device to skip 2fa Signed-off-by: 21pages <sunboeasy@gmail.com> * Update connection.rs --------- Signed-off-by: 21pages <sunboeasy@gmail.com> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -1471,3 +1471,28 @@ pub fn set_unlock_pin(pin: String) -> String {
|
||||
Err(err) => err.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn get_trusted_devices() -> String {
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
return Config::get_trusted_devices_json();
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
return ipc::get_trusted_devices();
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn remove_trusted_devices(json: &str) {
|
||||
let hwids = serde_json::from_str::<Vec<Bytes>>(json).unwrap_or_default();
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
Config::remove_trusted_devices(&hwids);
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
ipc::remove_trusted_devices(hwids);
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn clear_trusted_devices() {
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
Config::clear_trusted_devices();
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
ipc::clear_trusted_devices();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user