From fdd9a560b13b733fca57ad8b4c86b514f13a767f Mon Sep 17 00:00:00 2001 From: Dipesh Babu Date: Fri, 31 Jul 2026 05:50:31 -0400 Subject: [PATCH] Handle quoted authentication URLs --- sdk/typescript/src/auth.ts | 2 +- sdk/typescript/tests-ts/auth.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/typescript/src/auth.ts b/sdk/typescript/src/auth.ts index c8e7554..d53a42f 100644 --- a/sdk/typescript/src/auth.ts +++ b/sdk/typescript/src/auth.ts @@ -461,7 +461,7 @@ export async function runCodex( function preferredAuthUrl(value: string): string | null { for (const match of plainTerminalText(value).matchAll( - /https?:\/\/[^\s<>]+/g, + /https?:\/\/[^\s<>"']+/g, )) { const url = match[0].replace(/[.,;:!?)\]}]+$/, ""); try { diff --git a/sdk/typescript/tests-ts/auth.test.ts b/sdk/typescript/tests-ts/auth.test.ts index 08a2e43..fca13e1 100644 --- a/sdk/typescript/tests-ts/auth.test.ts +++ b/sdk/typescript/tests-ts/auth.test.ts @@ -58,7 +58,7 @@ if (args.join(" ") === "login --with-api-key") { console.error("Listening on http://[::ffff:127.0.0.1]:1455."); console.error("Listening on http://[::ffff:0.0.0.0]:1455."); console.error("Listening on http://[::127.0.0.1]:1455."); - console.error("Open \\u001b[32mhttps://127.auth.example.test/device\\u001b[0m"); + console.error('Open "\\u001b[32mhttps://127.auth.example.test/device\\u001b[0m"'); console.error("Enter this one-time code"); console.error("\\u001b[36m8356-V2EGR\\u001b[0m"); process.exit(0); @@ -167,7 +167,7 @@ setInterval(() => {}, 1000); await expect(logout(command, process.env)).resolves.toBeUndefined(); }); - test("captures interactive login metadata and completion", async () => { + test("captures quoted interactive login metadata and completion", async () => { const command = await fakeCodex(); let succeeded = false; const handle = new CodexLoginHandle(