fix: refresh Claude auth status after login flow#617
fix: refresh Claude auth status after login flow#617CoderLuii wants to merge 2 commits intositeboon:mainfrom
Conversation
📝 WalkthroughWalkthroughEnhanced authentication error handling in the Claude credentials verification flow by adding granular error responses for missing/unreadable credential files, expired OAuth tokens, and explicit error messages. Updated the login completion handler to await auth status validation before marking login as successful, ensuring proper auth confirmation. Changes
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/settings/hooks/useSettingsController.ts`:
- Around line 744-746: The code currently only updates save status when exitCode
=== 0 which can mask a successful auth re-check; remove the exitCode gating in
the block around checkAuthStatus()/authStatus and always
setSaveStatus(authStatus.authenticated ? 'success' : 'error') based on the
result of checkAuthStatus(); locate the logic in useSettingsController.ts where
exitCode and authStatus are used and update the conditional that calls
setSaveStatus (and optionally log non-zero exitCode separately) so final login
outcome relies on authStatus.authenticated not exitCode.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f0cbe17f-1be2-4ea3-a8a4-be6e20007296
📒 Files selected for processing (2)
server/routes/cli-auth.jssrc/components/settings/hooks/useSettingsController.ts
| if (exitCode === 0) { | ||
| setSaveStatus(authStatus.authenticated ? 'success' : 'error'); | ||
| } |
There was a problem hiding this comment.
Don’t gate final login outcome on process exit code after auth re-check.
At Line 744, requiring exitCode === 0 can hide a valid login when checkAuthStatus() confirms authentication, and non-zero exits skip setting an explicit error state.
Suggested fix
- if (exitCode === 0) {
- setSaveStatus(authStatus.authenticated ? 'success' : 'error');
- }
+ setSaveStatus(authStatus.authenticated ? 'success' : 'error');📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (exitCode === 0) { | |
| setSaveStatus(authStatus.authenticated ? 'success' : 'error'); | |
| } | |
| setSaveStatus(authStatus.authenticated ? 'success' : 'error'); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/settings/hooks/useSettingsController.ts` around lines 744 -
746, The code currently only updates save status when exitCode === 0 which can
mask a successful auth re-check; remove the exitCode gating in the block around
checkAuthStatus()/authStatus and always setSaveStatus(authStatus.authenticated ?
'success' : 'error') based on the result of checkAuthStatus(); locate the logic
in useSettingsController.ts where exitCode and authStatus are used and update
the conditional that calls setSaveStatus (and optionally log non-zero exitCode
separately) so final login outcome relies on authStatus.authenticated not
exitCode.
Summary
Testing
Summary by CodeRabbit