Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src-tauri/src/apple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use crate::{
error::Error,
events::EventKey,
log_watcher::service_log_watcher::spawn_log_watcher_task,
tray::show_main_window,
utils::{DEFAULT_ROUTE_IPV4, DEFAULT_ROUTE_IPV6},
ConnectionType,
};
Expand Down Expand Up @@ -121,6 +122,19 @@ pub async fn sync_connections_with_system(app_handle: &AppHandle) {
location.name
);
} else {
// Check if location requires MFA - if so, we need to cancel this connection
// and trigger MFA flow through the app
if location.mfa_enabled() {
info!(
"Location {} requires MFA but was started from system settings, canceling system connection and triggering MFA flow",
location.name
);
stop_tunnel_for_location(&location);
show_main_window(app_handle);
let _ = app_handle.emit(EventKey::MfaTrigger.into(), &location);
continue;
}

debug!("Adding connection for location {}", location.name);

app_state
Expand Down