CLI: fix status --all gateway auth selection

This commit is contained in:
Wes
2026-01-15 14:25:42 -08:00
parent bb665bf22c
commit 30d3e1da21

View File

@@ -118,10 +118,11 @@ export async function statusAllCommand(
const localFallbackAuth = resolveProbeAuth("local"); const localFallbackAuth = resolveProbeAuth("local");
const remoteAuth = resolveProbeAuth("remote"); const remoteAuth = resolveProbeAuth("remote");
const probeAuth = isRemoteMode && !remoteUrlMissing ? remoteAuth : localFallbackAuth;
const gatewayProbe = await probeGateway({ const gatewayProbe = await probeGateway({
url: connection.url, url: connection.url,
auth: remoteUrlMissing ? localFallbackAuth : remoteAuth, auth: probeAuth,
timeoutMs: Math.min(5000, opts?.timeoutMs ?? 10_000), timeoutMs: Math.min(5000, opts?.timeoutMs ?? 10_000),
}).catch(() => null); }).catch(() => null);
const gatewayReachable = gatewayProbe?.ok === true; const gatewayReachable = gatewayProbe?.ok === true;
@@ -289,7 +290,7 @@ export async function statusAllCommand(
? `unreachable (${gatewayProbe.error})` ? `unreachable (${gatewayProbe.error})`
: "unreachable"; : "unreachable";
const gatewayAuth = gatewayReachable const gatewayAuth = gatewayReachable
? ` · auth ${formatGatewayAuthUsed(remoteUrlMissing ? localFallbackAuth : remoteAuth)}` ? ` · auth ${formatGatewayAuthUsed(probeAuth)}`
: ""; : "";
const gatewaySelfLine = const gatewaySelfLine =
gatewaySelf?.host || gatewaySelf?.ip || gatewaySelf?.version || gatewaySelf?.platform gatewaySelf?.host || gatewaySelf?.ip || gatewaySelf?.version || gatewaySelf?.platform