mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-28 08:52:45 +00:00
fix: allow local quickstart control ui without pairing
This commit is contained in:
@@ -119,6 +119,35 @@ describe("configureGatewayForSetup", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("enables insecure local control ui auth for fresh quickstart loopback setups", async () => {
|
||||
mocks.randomToken.mockReturnValue("generated-token");
|
||||
|
||||
const result = await runGatewayConfig({
|
||||
flow: "quickstart",
|
||||
textQueue: [],
|
||||
});
|
||||
|
||||
expect(result.nextConfig.gateway?.controlUi?.allowInsecureAuth).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves explicit control ui auth policy in quickstart", async () => {
|
||||
mocks.randomToken.mockReturnValue("generated-token");
|
||||
|
||||
const result = await runGatewayConfig({
|
||||
flow: "quickstart",
|
||||
textQueue: [],
|
||||
nextConfig: {
|
||||
gateway: {
|
||||
controlUi: {
|
||||
allowInsecureAuth: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.nextConfig.gateway?.controlUi?.allowInsecureAuth).toBe(false);
|
||||
});
|
||||
|
||||
it("does not set password to literal 'undefined' when prompt returns undefined", async () => {
|
||||
mocks.randomToken.mockReturnValue("unused");
|
||||
const result = await runGatewayConfig({
|
||||
|
||||
@@ -294,6 +294,24 @@ export async function configureGatewayForSetup(
|
||||
},
|
||||
};
|
||||
|
||||
if (
|
||||
flow === "quickstart" &&
|
||||
bind === "loopback" &&
|
||||
!quickstartGateway.hasExisting &&
|
||||
nextConfig.gateway?.controlUi?.allowInsecureAuth === undefined
|
||||
) {
|
||||
nextConfig = {
|
||||
...nextConfig,
|
||||
gateway: {
|
||||
...nextConfig.gateway,
|
||||
controlUi: {
|
||||
...nextConfig.gateway?.controlUi,
|
||||
allowInsecureAuth: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
nextConfig = ensureControlUiAllowedOriginsForNonLoopbackBind(nextConfig, {
|
||||
requireControlUiEnabled: true,
|
||||
}).config;
|
||||
|
||||
Reference in New Issue
Block a user