Skip to content

Commit 02b8ad8

Browse files
committed
fix(auth): avoid docker -t for Claude oauth
1 parent 79cc901 commit 02b8ad8

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

packages/lib/src/usecases/auth-claude-oauth.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ type DockerLoginSpec = {
183183
readonly containerPath: string
184184
readonly env: ReadonlyArray<string>
185185
readonly args: ReadonlyArray<string>
186-
readonly tty: boolean
187186
}
188187

189188
const buildDockerLoginSpec = (
@@ -197,16 +196,13 @@ const buildDockerLoginSpec = (
197196
hostPath: accountPath,
198197
containerPath,
199198
env: [`CLAUDE_CONFIG_DIR=${containerPath}`, "BROWSER=echo"],
200-
args: ["auth", "login"],
201-
tty: process.stdin.isTTY && process.stdout.isTTY
199+
args: ["auth", "login"]
202200
})
203201

204202
const buildDockerLoginArgs = (spec: DockerLoginSpec): ReadonlyArray<string> => {
205-
const base: Array<string> = ["run", "--rm", "-i"]
206-
if (spec.tty) {
207-
base.push("-t")
208-
}
209-
base.push("-v", `${spec.hostPath}:${spec.containerPath}`)
203+
// NOTE: We intentionally avoid `-t` here.
204+
// We need stdin as a pipe (to feed the OAuth code), and `docker run -t` errors when stdin isn't a real TTY.
205+
const base: Array<string> = ["run", "--rm", "-i", "-v", `${spec.hostPath}:${spec.containerPath}`]
210206
for (const entry of spec.env) {
211207
const trimmed = entry.trim()
212208
if (trimmed.length === 0) {

0 commit comments

Comments
 (0)