Skip to content

fix: support glab OAuth2 token in GitLab auth fallback - #9

Merged
fabio-DigitalScience merged 1 commit into
mainfrom
fix/glab-oauth2-token
Mar 3, 2026
Merged

fabio-DigitalScience merged 1 commit into
mainfrom
fix/glab-oauth2-token

Conversation

@fabio-DigitalScience

Copy link
Copy Markdown
Collaborator

Summary

  • GlabCLIToken() now tries glab auth status -t first, which correctly exposes the active token for both OAuth2 and PAT-based glab authentication
  • Falls back to glab config get token --host gitlab.com for older glab versions
  • Fixes 401 errors when glab is authenticated via OAuth2 but the config file contains a stale/null PAT

Test plan

  • Verify glab auth status -t token extraction works with OAuth2-authenticated glab
  • Verify fallback to glab config get token still works when glab auth status -t is unavailable
  • Run go test ./internal/auth/...

🤖 Generated with Claude Code

GlabCLIToken() now tries `glab auth status -t` first, which correctly
exposes the active token for both OAuth2 and PAT auth. Falls back to
`glab config get token` for older glab versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fabio-DigitalScience
fabio-DigitalScience merged commit a0b3623 into main Mar 3, 2026
1 check passed
@fabio-DigitalScience
fabio-DigitalScience deleted the fix/glab-oauth2-token branch March 3, 2026 14:22
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