fix(security): prevent gateway token from defaulting to 'undefined' string
This commit is contained in:
parent
0175cedf0e
commit
201d7fa956
2 changed files with 5 additions and 2 deletions
|
|
@ -177,7 +177,8 @@ export async function promptGatewayConfig(
|
||||||
}),
|
}),
|
||||||
runtime,
|
runtime,
|
||||||
);
|
);
|
||||||
gatewayToken = String(tokenInput).trim() || randomToken();
|
const rawInput = tokenInput ? String(tokenInput).trim() : "";
|
||||||
|
gatewayToken = rawInput || randomToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authMode === "password") {
|
if (authMode === "password") {
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,9 @@ export async function configureGatewayForOnboarding(
|
||||||
placeholder: "Needed for multi-machine or non-loopback access",
|
placeholder: "Needed for multi-machine or non-loopback access",
|
||||||
initialValue: quickstartGateway.token ?? "",
|
initialValue: quickstartGateway.token ?? "",
|
||||||
});
|
});
|
||||||
gatewayToken = String(tokenInput).trim() || randomToken();
|
// FIX: Ensure undefined becomes an empty string, not "undefined" string
|
||||||
|
const rawInput = tokenInput ? String(tokenInput).trim() : "";
|
||||||
|
gatewayToken = rawInput || randomToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue