Skip to content

fix(auth): refresh token before token view#33

Closed
goncalossilva wants to merge 1 commit into
mainfrom
fix/auth-token-view-refresh
Closed

fix(auth): refresh token before token view#33
goncalossilva wants to merge 1 commit into
mainfrom
fix/auth-token-view-refresh

Conversation

@goncalossilva

@goncalossilva goncalossilva commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Make tdc auth token view use the existing refresh-capable token snapshot path for OAuth accounts
  • Preserve manual-token behavior and COMMS_API_TOKEN refusal behavior
  • Add regression coverage for refreshed OAuth token output and manual-token output

Test plan

  • npm run type-check
  • npm run lint:check
  • npx vitest run src/commands/auth/auth.test.ts src/lib/auth.test.ts
  • pre-push hook also ran full npm test: 42 files passed, 783 tests passed

Context

tdc auth token view previously printed the stored access token snapshot directly. For OAuth logins that token can be expired, causing scripts that call the raw Comms API to fail with 401.

This reuses the same refresh path used by normal authenticated CLI commands/status before printing.

@goncalossilva goncalossilva force-pushed the fix/auth-token-view-refresh branch from 36d4e64 to 7deafc3 Compare June 16, 2026 16:49
@goncalossilva

Copy link
Copy Markdown
Member Author

Closing this draft. The approach became messier than intended; we'll revisit with a simpler fix.

@goncalossilva goncalossilva deleted the fix/auth-token-view-refresh branch June 16, 2026 17:01
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