You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Minimal launcher page — fires the deep link and closes immediately.
485
-
// No visible UI: consent lives entirely in the McpMux app (desktop modal
486
-
// or web admin SSE modal). The fallback section only appears if the
487
-
// browser blocks window.close() (tab was not script-opened).
484
+
// When the gateway is exposed beyond loopback, a client that reached this
485
+
// page from another machine can't complete the desktop consent (the
486
+
// mcpmux:// deep link fires only on the host). Surface the API-key path so a
487
+
// remote user isn't left at a dead end.
488
+
let network_bind = state.read().await.network_bind;
489
+
let network_note = if network_bind {
490
+
format!(
491
+
r#"<p style="margin:0 0 1rem;padding:0.85rem 1rem;border-radius:8px;background:rgba(218,119,86,0.12);border:1px solid rgba(218,119,86,0.3);color:#d8b08c;font-size:0.85rem;line-height:1.45;text-align:left;"><strong style="color:#DA7756;">Connecting from another machine?</strong> This approval only completes on the computer running {app_name}. For a remote or headless client, register an <strong>API-key client</strong> in {app_name} (Clients tab) and connect with that key instead of this browser flow.</p>"#
492
+
)
493
+
}else{
494
+
String::new()
495
+
};
496
+
let body_style = if network_bind {
497
+
String::new()
498
+
}else{
499
+
"display: none;".to_string()
500
+
};
501
+
let redirect_script = if network_bind {
502
+
String::new()
503
+
}else{
504
+
format!(
505
+
r#"
506
+
<script>
507
+
window.location.href = "{deep_link_url}";
508
+
setTimeout(function() {{
509
+
try {{ window.close(); }} catch(e) {{}}
510
+
// If window.close() was blocked, reveal the fallback.
511
+
document.body.style.display = '';
512
+
}}, 300);
513
+
</script>"#
514
+
)
515
+
};
516
+
517
+
// Minimal launcher page — fires the deep link and closes immediately on
518
+
// loopback binds. On network binds the fallback stays visible with guidance
519
+
// toward API-key clients because the deep link only works on the host.
0 commit comments