mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 10:41:23 +00:00
refactor: dedupe auth session readers
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
signalVerifiedGatewayPidSync,
|
||||
} from "../../infra/gateway-processes.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import { recoverInstalledLaunchAgent } from "./launchd-recovery.js";
|
||||
@@ -77,8 +78,8 @@ async function assertUnmanagedGatewayRestartEnabled(port: number): Promise<void>
|
||||
const probe = await probeGateway({
|
||||
url: `${scheme}://127.0.0.1:${port}`,
|
||||
auth: {
|
||||
token: process.env.OPENCLAW_GATEWAY_TOKEN?.trim() || undefined,
|
||||
password: process.env.OPENCLAW_GATEWAY_PASSWORD?.trim() || undefined,
|
||||
token: normalizeOptionalString(process.env.OPENCLAW_GATEWAY_TOKEN),
|
||||
password: normalizeOptionalString(process.env.OPENCLAW_GATEWAY_PASSWORD),
|
||||
},
|
||||
timeoutMs: 1_000,
|
||||
}).catch(() => null);
|
||||
|
||||
Reference in New Issue
Block a user