fix(auth/token): restore legacy unkeyed keyring lookup when --user is… · cli/cli@604120a · GitHub
Skip to content

Commit 604120a

Browse files
babakksCopilot
andauthored
fix(auth/token): restore legacy unkeyed keyring lookup when --user is omitted
Under --secure-storage, the non-refreshable keyring fallback was keyed on the resolved active username rather than the --user flag value. When only the legacy unkeyed keyring slot exists but an active user is recorded, this read the empty per-user slot and reported no token found, a regression from the original behaviour. Key the fallback on opts.Username so an omitted --user reads the legacy unkeyed slot exactly as before, while the refresh lookup still resolves a username because refreshable tokens are always stored per user. Also fold the old unkeyed branch of --secure-storage --no-refresh into the same fallback. Add pinning tests covering both --secure-storage branches with only the legacy slot present. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ac178b5a-5b62-49bd-9e83-4796c7ddec46
1 parent 6c07966 commit 604120a

2 files changed

Lines changed: 46 additions & 10 deletions

File tree

‎pkg/cmd/auth/token/token.go‎

Lines changed: 13 additions & 10 deletions

‎pkg/cmd/auth/token/token_test.go‎

Lines changed: 33 additions & 0 deletions

0 commit comments

Comments
 (0)