Commit ef29aac
authored
fix(auth): always show login URL so headless login can complete (#420)
On a machine with no display (e.g. an SSH'd server), login hung and
timed out after 5 minutes. hasBrowser() returned true because xdg-open
was installed, so browser.OpenURL was called; xdg-open printed "no
DISPLAY environment variable specified" to stderr but exited 0, so
OpenURL returned nil and the CLI printed "Waiting for login to complete
in browser..." without ever showing the login URL. With no URL to visit,
login could never complete.
Follow Claude Code's pattern: always attempt to open the browser
best-effort, but always print the login URL as a fallback so the user is
never stranded. Discard the launcher's stderr (pkg/browser pipes it to
ours) to suppress the confusing "no DISPLAY" noise. This removes the need
for platform/display detection, so hasBrowser() is deleted.1 parent f636937 commit ef29aac
1 file changed
Lines changed: 16 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
327 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
328 | 335 | | |
329 | 336 | | |
330 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
331 | 340 | | |
332 | 341 | | |
333 | 342 | | |
| |||
337 | 346 | | |
338 | 347 | | |
339 | 348 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
346 | 352 | | |
347 | 353 | | |
348 | 354 | | |
| |||
352 | 358 | | |
353 | 359 | | |
354 | 360 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | 361 | | |
371 | 362 | | |
372 | 363 | | |
| |||
0 commit comments