Commit eeef8a3
fix: check .claude.json for OAuth auth in profile scorer (AndyMik90#652)
* fix: check .claude.json for OAuth auth in profile scorer
The isProfileAuthenticated() function only checked legacy credential files
(credentials, credentials.json, .credentials, settings.json) when determining
if a profile is eligible for auto-switch.
Claude Code CLI (v1.0+) stores OAuth authentication in .claude.json with an
oauthAccount field containing accountUuid and emailAddress. This meant profiles
authenticated via OAuth were silently rejected by the profile scorer, causing
auto-switch to fail even when 'Reactive Recovery' was enabled.
This fix adds a check for .claude.json containing oauthAccount info before
falling through to legacy credential file checks.
Fixes incomplete resolution of AndyMik90#365 and AndyMik90#43
* fix: add type validation and error logging per review feedback
- Add typeof check before accessing oauthAccount properties
- Log parse errors with console.warn for debugging malformed .claude.json
Co-authored-by: gemini-code-assist[bot] <176abortvfax+gemini-code-assist[bot]@Fusers.noreply.github.com>
---------
Co-authored-by: gemini-code-assist[bot] <176abortvfax+gemini-code-assist[bot]@Fusers.noreply.github.com>
Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>1 parent e1e8943 commit eeef8a3
1 file changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| |||
0 commit comments