Skip to content

Commit 9eb2fa2

Browse files
authored
Handle quoted authentication URLs (#179)
1 parent 66778d0 commit 9eb2fa2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

sdk/typescript/src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ export async function runCodex(
461461

462462
function preferredAuthUrl(value: string): string | null {
463463
for (const match of plainTerminalText(value).matchAll(
464-
/https?:\/\/[^\s<>]+/g,
464+
/https?:\/\/[^\s<>"']+/g,
465465
)) {
466466
const url = match[0].replace(/[.,;:!?)\]}]+$/, "");
467467
try {

sdk/typescript/tests-ts/auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if (args.join(" ") === "login --with-api-key") {
5858
console.error("Listening on http://[::ffff:127.0.0.1]:1455.");
5959
console.error("Listening on http://[::ffff:0.0.0.0]:1455.");
6060
console.error("Listening on http://[::127.0.0.1]:1455.");
61-
console.error("Open \\u001b[32mhttps://127.auth.example.test/device\\u001b[0m");
61+
console.error('Open "\\u001b[32mhttps://127.auth.example.test/device\\u001b[0m"');
6262
console.error("Enter this one-time code");
6363
console.error("\\u001b[36m8356-V2EGR\\u001b[0m");
6464
process.exit(0);
@@ -167,7 +167,7 @@ setInterval(() => {}, 1000);
167167
await expect(logout(command, process.env)).resolves.toBeUndefined();
168168
});
169169

170-
test("captures interactive login metadata and completion", async () => {
170+
test("captures quoted interactive login metadata and completion", async () => {
171171
const command = await fakeCodex();
172172
let succeeded = false;
173173
const handle = new CodexLoginHandle(

0 commit comments

Comments
 (0)