From b74c5cfda86e81a07fecd70f4af797ad7616b987 Mon Sep 17 00:00:00 2001 From: argenis de la rosa Date: Wed, 18 Mar 2026 19:50:26 -0400 Subject: [PATCH] fix(gateway): move pairing code below dashboard URL in terminal banner Repositions the one-time pairing code display to appear directly below the dashboard URL for cleaner terminal output, and removes the duplicate display that was showing at the bottom of the route list. Co-Authored-By: Claude Opus 4.6 --- src/gateway/mod.rs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index 63c37333b..0ab7bd463 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -633,6 +633,21 @@ pub async fn run_gateway(host: &str, port: u16, config: Config) -> Result<()> { println!(" 🌐 Public URL: {url}"); } println!(" 🌐 Web Dashboard: http://{display_addr}/"); + if let Some(code) = pairing.pairing_code() { + println!(); + println!(" 🔐 PAIRING REQUIRED — use this one-time code:"); + println!(" ┌──────────────┐"); + println!(" │ {code} │"); + println!(" └──────────────┘"); + println!(); + } else if pairing.require_pairing() { + println!(" 🔒 Pairing: ACTIVE (bearer token required)"); + println!(" To pair a new device: zeroclaw gateway get-paircode --new"); + println!(); + } else { + println!(" ⚠️ Pairing: DISABLED (all requests accepted)"); + println!(); + } println!(" POST /pair — pair a new client (X-Pairing-Code header)"); println!(" POST /webhook — {{\"message\": \"your prompt\"}}"); if whatsapp_channel.is_some() { @@ -656,19 +671,6 @@ pub async fn run_gateway(host: &str, port: u16, config: Config) -> Result<()> { } println!(" GET /health — health check"); println!(" GET /metrics — Prometheus metrics"); - if let Some(code) = pairing.pairing_code() { - println!(); - println!(" 🔐 PAIRING REQUIRED — use this one-time code:"); - println!(" ┌──────────────┐"); - println!(" │ {code} │"); - println!(" └──────────────┘"); - println!(" Send: POST /pair with header X-Pairing-Code: {code}"); - } else if pairing.require_pairing() { - println!(" 🔒 Pairing: ACTIVE (bearer token required)"); - println!(" To pair a new device: zeroclaw gateway get-paircode --new"); - } else { - println!(" ⚠️ Pairing: DISABLED (all requests accepted)"); - } println!(" Press Ctrl+C to stop.\n"); crate::health::mark_component_ok("gateway");