fix: Token refresh on re-login and account switch#5
fix: Token refresh on re-login and account switch#5hiscc wants to merge 1 commit intoXueshiQiao:mainfrom
Conversation
- Added auto-switch feature to switch accounts when usage exceeds a specified threshold. - Introduced AppStorage properties for enabling auto-switch and setting the usage threshold. - Enhanced AppState to manage cached usage data and handle auto-switch logic. - Updated UI to display usage in the menu bar and added settings for auto-switch. - Improved error handling for account usage fetching and token refresh processes. - Added changelog to document changes and improvements.
|
Hi @hiscc, thanks so much for taking the time to work on this PR! It's clear you've put real thought into the auto-switch feature and the token refresh improvements. Several ideas here are genuinely valuable for the project. I've done a thorough review and wanted to share some feedback before we can move forward with merging. Blockers
Suggestions
What I really like
I'd love to get the good parts of this merged. Happy to discuss any of the above — let me know your thoughts! |
Summary
login()breaking when CLI exits non-zero after opening browser ("Opening browser to sign in...")loginNewAccountnot refreshing usage when re-logging existing account (was returning early without callingrefresh())reauthenticateAccountnot clearing expired error state after successswitchAccountto keep backups freshdeferguard forisAutoSwitchingflagTest plan
🤖 Generated with Claude Code