Skip to content

fix(auth): pass username argument to OAuth2Flow - #60

Merged
santiagomed merged 1 commit into
xdevplatform:mainfrom
chilang:fix/oauth2-username-passthrough
Apr 19, 2026
Merged

fix(auth): pass username argument to OAuth2Flow#60
santiagomed merged 1 commit into
xdevplatform:mainfrom
chilang:fix/oauth2-username-passthrough

Conversation

@chilang

@chilang chilang commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • auth oauth2 always passes "" to OAuth2Flow(), ignoring any positional USERNAME argument
  • This forces the flow through fetchUsername()GET /2/users/me, which has been returning 403 for many developers since the March 2026 platform regression
  • When a username is provided (xurl auth oauth2 alice), it should be passed through so OAuth2Flow skips the broken lookup and stores the token directly

Changes

One-line fix in cli/auth.go: read args[0] when present and pass it to a.OAuth2Flow(username) instead of hardcoded "".

Test plan

  • xurl auth oauth2 <username> completes successfully (skips /2/users/me)
  • xurl auth oauth2 (no args) retains existing behavior (calls fetchUsername)
  • xurl auth status shows the token stored under the provided username
  • xurl whoami works with the stored token

Fixes #47

The `auth oauth2` command always passes an empty string to
`OAuth2Flow()`, ignoring any positional username argument. This forces
the flow through `fetchUsername()` which calls `GET /2/users/me` — an
endpoint that has been returning 403 for many developers since the
March 2026 platform regression.

When a username is provided (`xurl auth oauth2 alice`), pass it
through so `OAuth2Flow` skips the broken `/2/users/me` lookup and
stores the token under the given username directly.

Fixes xdevplatform#47
@CLAassistant

CLAassistant commented Apr 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@santiagomed santiagomed left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, @chilang — this unblocks auth for a lot of users!

@santiagomed
santiagomed merged commit 23a5fdd into xdevplatform:main Apr 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants