{"draft":null,"from":59,"to":60,"files":[{"path":"client/src/box.ts","added":4,"removed":0,"diff":"--- a/client/src/box.ts\n+++ b/client/src/box.ts\n@@ -185,6 +185,8 @@\n \treadonly now?: () => number;\n \t/** Where the code and link go while login waits: stderr, so stdout stays quiet. */\n \treadonly say: (line: string) => void;\n+\t/** Opens the approve page in a browser, answering whether it tried. None where it shouldn't (--no-browser, SSH, CI). */\n+\treadonly open?: (url: string) => boolean;\n }\n \n /**\n@@ -202,6 +204,8 @@\n \tconst expiresIn = Math.min(Number(start.body.expires_in) || 900, MAX_LOGIN_WAIT_S);\n \tif (typeof code !== \"string\" || typeof link !== \"string\" || typeof device !== \"string\")\n \t\tthrow new UsageError(`${originOf(server)} didn't give a code to approve`);\n+\t// The page opens with the code in it, so nobody copies a link by hand. The link and code are printed all the same.\n+\tif (io.open?.(link)) io.say(\"Opening the approve page in your browser.\");\n \tio.say(`To sign this box in, open ${link} and approve the code ${code}.`);\n \tio.say(\"Waiting for approval. Ctrl-C stops waiting, and abso stops by itself when the code runs out.\");\n \tconst until = now() + expiresIn * 1000;"}],"unmatched":[]}