fix(security): prevent gateway token from defaulting to 'undefined' string
This commit is contained in:
committed by
Gustavo Madeira Santana
parent
0175cedf0e
commit
201d7fa956
@@ -177,7 +177,8 @@ export async function promptGatewayConfig(
|
||||
}),
|
||||
runtime,
|
||||
);
|
||||
gatewayToken = String(tokenInput).trim() || randomToken();
|
||||
const rawInput = tokenInput ? String(tokenInput).trim() : "";
|
||||
gatewayToken = rawInput || randomToken();
|
||||
}
|
||||
|
||||
if (authMode === "password") {
|
||||
|
||||
@@ -182,7 +182,9 @@ export async function configureGatewayForOnboarding(
|
||||
placeholder: "Needed for multi-machine or non-loopback access",
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user