File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments