Skip to content

s1 login: wait for browser callback and device code together - #19

Merged
fatwang2 merged 1 commit into
masterfrom
claude/project-thread-fcpc2r
Nov 24, 2026
Merged

fatwang2 merged 1 commit into
masterfrom
claude/project-thread-fcpc2r

Conversation

@fatwang2

Copy link
Copy Markdown
Member

Requested by fatwang2 · project thread

Why

Follow-up to #18. Users shouldn't have to know whether to pass --device. Like Claude Code's login, one command should work whether the browser is on this machine or another one.

What

  • s1 login now runs both flows side by side: the loopback browser login (opens the browser as before) and the device code flow (prints URL + short code for another device). The first to succeed wins and the other is cancelled (local callback server closed, polling stopped). It fails only if both fail.
  • Device hint prints after the browser line so output reads in order.
  • --device still runs only the short-code flow. Removed the SSH hint added in Add s1 login --device for cross-device sign-in #18 (no longer needed).
  • AbortSignal support in loginWithBrowser and loginWithDeviceCode.
  • README + changelog (Unreleased).

Testing

  • npm test 51/51 (new test: device polling stops on cancel).
  • Real run against production Clerk: plain s1 login --no-browser in a cloud container, approved from another device via the device link; tokens saved, /usage validation passed, process exited 0 (callback server closed).

Generated by Claude Code

@fatwang2
fatwang2 merged commit 50df96d into master Nov 24, 2026
2 checks passed
@fatwang2 fatwang2 mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants