Skip to content

* fix: reuse auth profile in read-only environments - #17

Open
weekwood wants to merge 1 commit into
easysoft:mainfrom
weekwood:fix-read-only-auth-profile
Open

weekwood wants to merge 1 commit into
easysoft:mainfrom
weekwood:fix-read-only-auth-profile

Conversation

@weekwood

Copy link
Copy Markdown

Summary

  • avoid rewriting an existing profile config when the store is initialized for reads
  • treat lastUsedTime persistence as best-effort so a valid token remains usable when profile storage is read-only
  • add regression coverage for both read paths

Root cause

Configstore received an empty defaults object, which rewrote the config during construction. In addition, ensureAuth() always persisted lastUsedTime. In sandboxed or otherwise read-only environments, either write failed and the CLI surfaced E1005, even though the stored token was valid.

Verification

  • bun test — 186 passed, 0 failed
  • bun run typecheck
  • bun run build
  • installed the packed CLI locally and confirmed zentao --version and an authenticated zentao story 326 --format=json both reuse the existing token without another login

@weekwood
weekwood marked this pull request as ready for review August 21, 2026 08:53
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