diff --git a/.changeset/odd-ladybugs-punch.md b/.changeset/odd-ladybugs-punch.md new file mode 100644 index 00000000..b735f558 --- /dev/null +++ b/.changeset/odd-ladybugs-punch.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +Fix issue where fallback request to retrieve cost was not using correct auth token diff --git a/src/api/providers/cline.ts b/src/api/providers/cline.ts index b65911a9..43f831cb 100644 --- a/src/api/providers/cline.ts +++ b/src/api/providers/cline.ts @@ -172,10 +172,13 @@ export class ClineHandler implements ApiHandler { try { // TODO: replace this with firebase auth // TODO: use global API Host - + const clineAccountAuthToken = await this._authService.getAuthToken() + if (!clineAccountAuthToken) { + throw new Error(CLINE_ACCOUNT_AUTH_ERROR_MESSAGE) + } const response = await axios.get(`${this.clineAccountService.baseUrl}/generation?id=${this.lastGenerationId}`, { headers: { - Authorization: `Bearer ${this.options.clineAccountId}`, + Authorization: `Bearer ${clineAccountAuthToken}`, }, timeout: 15_000, // this request hangs sometimes })