Skip to content

fix(auth): harden oauth device polling and add device-auth flag#83

Merged
samzong merged 1 commit into
mainfrom
fix/auth-oauth-device-flow
Jul 1, 2026
Merged

fix(auth): harden oauth device polling and add device-auth flag#83
samzong merged 1 commit into
mainfrom
fix/auth-oauth-device-flow

Conversation

@samzong

@samzong samzong commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Harden OAuth 2.0 device-flow token polling to accept standard error field values (authorization_pending, slow_down, access_denied, expired_token), decode JSON bodies on non-2xx responses, and add auth login --device-auth. Update README, CLI usage docs, and generated Skill guidance to reference the new flag.

Verification

go test ./internal/auth/... ./internal/codegen/render/...

Compatibility

  • Adds auth login --device-auth (alias for OAuth device login; still accepts --auth-type oauth).
  • OAuth device polling now tolerates RFC 8628-style error responses instead of failing on HTTP 400 with authorization_pending.
  • Generated Skill text switches device-login examples from --auth-type oauth to --device-auth.

Checklist

  • Tests or focused verification cover the changed surface.
  • User-facing behavior changes are documented.
  • Generated output under internal/generated/, .cache/, and ad-hoc skills/<cli-name>/ directories is not committed.
  • Commits are signed off when this is ready to merge.

Handle OAuth 2.0 device-flow error fields (authorization_pending,
slow_down, access_denied, expired_token) when polling token endpoints,
decode JSON bodies even on non-2xx responses, and expose auth login
--device-auth with updated docs and generated Skill guidance.

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong samzong merged commit 9ef5601 into main Jul 1, 2026
3 checks passed
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.

1 participant