fix: repair local control ui auth on quickstart reruns

This commit is contained in:
Shakker
2026-03-27 09:49:10 +00:00
committed by Shakker
parent 8270baa1d0
commit 3d609b112e
2 changed files with 29 additions and 1 deletions

View File

@@ -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({

View File

@@ -297,7 +297,6 @@ export async function configureGatewayForSetup(
if (
flow === "quickstart" &&
bind === "loopback" &&
!quickstartGateway.hasExisting &&
nextConfig.gateway?.controlUi?.allowInsecureAuth === undefined
) {
nextConfig = {