mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-28 02:12:07 +00:00
fix: repair local control ui auth on quickstart reruns
This commit is contained in:
@@ -148,6 +148,35 @@ describe("configureGatewayForSetup", () => {
|
||||
expect(result.nextConfig.gateway?.controlUi?.allowInsecureAuth).toBe(false);
|
||||
});
|
||||
|
||||
it("enables insecure local control ui auth when quickstart reuses an existing loopback config", async () => {
|
||||
mocks.randomToken.mockReturnValue("generated-token");
|
||||
const prompter = createPrompter({
|
||||
selectQueue: [],
|
||||
textQueue: [],
|
||||
});
|
||||
const runtime = createRuntime();
|
||||
|
||||
const result = await configureGatewayForSetup({
|
||||
flow: "quickstart",
|
||||
baseConfig: {},
|
||||
nextConfig: {
|
||||
gateway: {
|
||||
port: 18789,
|
||||
bind: "loopback",
|
||||
},
|
||||
},
|
||||
localPort: 18789,
|
||||
quickstartGateway: {
|
||||
...createQuickstartGateway("token"),
|
||||
hasExisting: true,
|
||||
},
|
||||
prompter,
|
||||
runtime,
|
||||
});
|
||||
|
||||
expect(result.nextConfig.gateway?.controlUi?.allowInsecureAuth).toBe(true);
|
||||
});
|
||||
|
||||
it("does not set password to literal 'undefined' when prompt returns undefined", async () => {
|
||||
mocks.randomToken.mockReturnValue("unused");
|
||||
const result = await runGatewayConfig({
|
||||
|
||||
@@ -297,7 +297,6 @@ export async function configureGatewayForSetup(
|
||||
if (
|
||||
flow === "quickstart" &&
|
||||
bind === "loopback" &&
|
||||
!quickstartGateway.hasExisting &&
|
||||
nextConfig.gateway?.controlUi?.allowInsecureAuth === undefined
|
||||
) {
|
||||
nextConfig = {
|
||||
|
||||
Reference in New Issue
Block a user