fix(docker): retain stored SSH credential association (#1543)

This commit is contained in:
ZacharyZcR authored and GitHub committed 2026-10-03 21:02:21 +08:00
1 parent 117e125d55
commit 4785bf5dfa
2 files changed
+43 -6

No files matched your search

+7 -5
View File
@@ -210,11 +210,13 @@ export function registerRoutes(router: Router, { ctx, sessions, log }: Deps) {
),
);
const target: PluginSshHost = {
...host,
id: numericHostId,
port: host.port || 22,
};
const hasAuthOverride = [
userProvidedPassword,
userProvidedSshKey,
userProvidedKeyPassword,
].some((value) => typeof value === "string" && value.length > 0);
// Core associates the redacted host object with its stored credentials.
const target: PluginSshHost = hasAuthOverride ? { ...host } : host;
if (typeof userProvidedPassword === "string" && userProvidedPassword) {
target.password = userProvidedPassword;
target.authType = "password";