Skip to content

Commit af1c50b

Browse files
authored
[MacOS] Trigger MFA if needed when connecting via system settings (#700)
1 parent 5823399 commit af1c50b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src-tauri/src/apple.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use crate::{
4343
error::Error,
4444
events::EventKey,
4545
log_watcher::service_log_watcher::spawn_log_watcher_task,
46+
tray::show_main_window,
4647
utils::{DEFAULT_ROUTE_IPV4, DEFAULT_ROUTE_IPV6},
4748
ConnectionType,
4849
};
@@ -121,6 +122,19 @@ pub async fn sync_connections_with_system(app_handle: &AppHandle) {
121122
location.name
122123
);
123124
} else {
125+
// Check if location requires MFA - if so, we need to cancel this connection
126+
// and trigger MFA flow through the app
127+
if location.mfa_enabled() {
128+
info!(
129+
"Location {} requires MFA but was started from system settings, canceling system connection and triggering MFA flow",
130+
location.name
131+
);
132+
stop_tunnel_for_location(&location);
133+
show_main_window(app_handle);
134+
let _ = app_handle.emit(EventKey::MfaTrigger.into(), &location);
135+
continue;
136+
}
137+
124138
debug!("Adding connection for location {}", location.name);
125139

126140
app_state

0 commit comments

Comments
 (0)