-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Checklist
- I searched existing issues and this hasn't been reported
Area
Frontend
Operating System
macOS
Version
2.7.2-beta.10 (also affects 2.7.1)
What happened?
The EnvConfigModal (authentication dialog) shows the "Default" profile as authenticated when the user has a valid Claude Code OAuth token in macOS Keychain. However, when clicking "Use This Account", it fails with error: "Selected profile does not have a valid token".
Root Cause
EnvConfigModal.tsx has inconsistent logic for determining if a profile is authenticated:
-
Profile Detection (lines 104-106) marks profiles as authenticated if:
p.oauthToken || (p.isDefault && p.configDir)
This shows Default profile with Keychain access as ✓ authenticated in the UI.
-
Token Validation (lines 156-161) when clicking "Use This Account":
if (\!profile?.oauthToken) { setError('Selected profile does not have a valid token'); return; }
This ONLY accepts profiles with the
oauthTokenproperty populated. -
The Problem: The Keychain token is available in the backend (
get_token_from_keychain()works), but is NOT loaded intoprofile.oauthTokenin the frontend whengetClaudeProfiles()is called.
Steps to reproduce
- Have a valid Claude Code OAuth token in macOS Keychain (from
claude setup-token) - Launch Auto-Claude v2.7.1+ (fresh install with no prior config)
- Try to use a feature requiring authentication (e.g., Ideation)
- EnvConfigModal appears showing "Default" profile as authenticated
- Click "Use This Account" button
- Error appears: "Selected profile does not have a valid token"
Expected behavior
When getClaudeProfiles() is called for a Default profile with configDir (Keychain access):
- The backend should call
get_token_from_keychain()to retrieve the token - Populate the
oauthTokenfield in the returned profile data - Frontend can then successfully use the profile when clicking "Use This Account"
Workaround
Users must manually enter the token via "Enter token manually" section.
Proposed Fix
Modify the backend IPC handler for getClaudeProfiles to:
- Detect when a profile is Default with
configDirbut nooauthToken - Call
get_token_from_keychain()(fromapps/backend/core/auth.py) - Populate the
oauthTokenfield in the profile response
Impact
- Users with valid Keychain tokens cannot authenticate via the UI
- Confusing UX: Shows as "authenticated" but fails when trying to use it
- Affects macOS users exclusively (Keychain is macOS-only)
Related
- Related to original Keychain integration in macOS does not hold token at ~/.config/claude/credentials.json but in keychain #43 (v2.6.0)
- Similar to "I've Installed It" button in GitHub CLI modal does nothing - modal keeps reloading #233 (GitHub CLI modal issue)
Technical Context
Files involved:
apps/frontend/src/renderer/components/EnvConfigModal.tsx(frontend UI logic)apps/backend/core/auth.py(Keychain token retrieval)- Backend IPC handler for
getClaudeProfiles(needs modification)
I'll submit a PR with the fix shortly.