Skip to content

feat(auth): self-service browser login (OAuth device flow)#4

Merged
lu-ochenty merged 1 commit into
mainfrom
feat/device-flow-login
Jun 30, 2026
Merged

feat(auth): self-service browser login (OAuth device flow)#4
lu-ochenty merged 1 commit into
mainfrom
feat/device-flow-login

Conversation

@LucasLeguizamo

Copy link
Copy Markdown
Contributor

What

ft login (no --key) now runs the OAuth 2.0 Device Authorization Grant (RFC 8628):

  1. POST /auth/device/code → prints a short user code + URL and opens the browser.
  2. Polls POST /auth/device/token, honoring slow_down / expired_token / access_denied.
  3. On approval, stores the minted access_token + workspace and verifies via /me.

Anyone with a FreeTicket account can now log in without a backend-issued API key. ft login --key ft_live_… stays for headless CI.

Contract

Consumes POST /auth/device/code + POST /auth/device/token (AppFreeticket/free-admin#160). Client regenerated from the production spec; sync-openapi now defaults to production (local backend via FT_OPENAPI_URL).

Notes

  • The token endpoint returns access_token + workspaces[]; with multiple workspaces the CLI uses the first and prints how to switch (--workspace).
  • Downstream (configureClient, saveConfig) unchanged — the token is stored and sent as Bearer, same as an API key.

Test

typecheck ✓ · vitest ✓ · build ✓ · ft login --help shows --key now optional. End-to-end device flow needs the live backend.

🤖 Generated with Claude Code

`ft login` (no --key) now runs the OAuth 2.0 Device Authorization Grant
(RFC 8628): prints a user code, opens the browser, and polls
POST /auth/device/token (honoring slow_down/expired_token/access_denied)
until approval, then stores the minted session and verifies it via /me.
Anyone with a FreeTicket account can log in without a backend-issued
API key; `ft login --key ft_live_…` stays for headless CI.

Regenerates the client from the production contract (free-admin#160:
POST /auth/device/code + POST /auth/device/token) and points
sync-openapi at production by default (local backend via FT_OPENAPI_URL).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@lu-ochenty lu-ochenty merged commit 9bbb5a4 into main Jun 30, 2026
1 check passed
@LucasLeguizamo LucasLeguizamo deleted the feat/device-flow-login branch June 30, 2026 19:02
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