feat(cli): add streamlined path auth login --token#116
Closed
benbaarber wants to merge 1 commit into
Closed
Conversation
Adds a browser-free way to authenticate the CLI. When already signed in on the Pathbase site, the user can copy a single ready-to-paste `path auth login --token <token>` command instead of doing the open-browser / copy-8-char-code / redeem dance. The token is the bearer credential directly (no redeem round-trip). The CLI validates it via GET /users/me before writing anything, so a bad or expired token fails fast and never leaves a half-written session on disk. `--token` conflicts with `--code`; the interactive prompt now also points users who are already signed in at the one-line token command. Bumps path-cli 0.14.0 -> 0.15.0.
|
🔍 Preview deployed: https://e9587d4f.toolpath.pages.dev |
Collaborator
Author
|
Abandoning: the grant code already redeems through the existing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a browser-free way to authenticate the CLI:
path auth login --token <token>. When you're already signed in on the Pathbase site, it can hand you a single ready-to-paste command instead of the open-browser → copy-8-char-code → redeem dance. The existing code flow is unchanged.GET /api/v1/users/mebefore writing anything, so a bad/expired token fails fast and never leaves a half-written session on disk. On success it stores the samecredentials.json(0600) the code flow produces.--tokenconflicts with--code.--url(→$PATHBASE_URL→https://pathbase.dev) works with both flows. The interactive prompt now also points already-signed-in users at the one-line token command.--token; token/code conflict; mock/users/medrives a successful login persisted forauth status; rejected 401 errors and leaves no session). Full path-cli suite + clippy green.The token-issuing UI is a Pathbase-site change (separate repo); this CLI side accepts whatever bearer token that page displays.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.