fix(auth): add username option for basic auth in RunCommand (#25600)
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
This commit is contained in:
co-authored by
Shoubhit Dash
parent
c06af70ab0
commit
adb7cb1037
@@ -276,6 +276,11 @@ export const RunCommand = effectCmd({
|
|||||||
type: "string",
|
type: "string",
|
||||||
describe: "basic auth password (defaults to OPENCODE_SERVER_PASSWORD)",
|
describe: "basic auth password (defaults to OPENCODE_SERVER_PASSWORD)",
|
||||||
})
|
})
|
||||||
|
.option("username", {
|
||||||
|
alias: ["u"],
|
||||||
|
type: "string",
|
||||||
|
describe: "basic auth username (defaults to OPENCODE_SERVER_USERNAME or 'opencode')",
|
||||||
|
})
|
||||||
.option("dir", {
|
.option("dir", {
|
||||||
type: "string",
|
type: "string",
|
||||||
describe: "directory to run in, path on remote server if attaching",
|
describe: "directory to run in, path on remote server if attaching",
|
||||||
@@ -657,7 +662,7 @@ export const RunCommand = effectCmd({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (args.attach) {
|
if (args.attach) {
|
||||||
const headers = ServerAuth.headers({ password: args.password })
|
const headers = ServerAuth.headers({ password: args.password, username: args.username })
|
||||||
const sdk = createOpencodeClient({ baseUrl: args.attach, directory, headers })
|
const sdk = createOpencodeClient({ baseUrl: args.attach, directory, headers })
|
||||||
return await execute(sdk)
|
return await execute(sdk)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user