{"record":{"id":"e26b5ee86437a7cf","repo":"diegosouzapw/OmniRoute","slug":"cline-token-exchange-failed-error","errorCode":null,"errorMessage":"Cline token exchange failed: ${error}","messagePattern":"Cline token exchange failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/providers/cline.ts","lineNumber":60,"sourceCode":"      };\n    } catch (e) {\n      const response = await fetch(config.tokenExchangeUrl, {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          Accept: \"application/json\",\n        },\n        body: JSON.stringify({\n          grant_type: \"authorization_code\",\n          code: code,\n          client_type: \"extension\",\n          redirect_uri: redirectUri,\n        }),\n      });\n\n      if (!response.ok) {\n        const error = await response.text();\n        throw new Error(`Cline token exchange failed: ${error}`);\n      }\n\n      const data = await response.json();\n      return {\n        access_token: data.data?.accessToken || data.accessToken,\n        refresh_token: data.data?.refreshToken || data.refreshToken,\n        email: data.data?.userInfo?.email || \"\",\n        expires_at: data.data?.expiresAt || data.expiresAt,\n      };\n    }\n  },\n  mapTokens: (tokens) => {\n    const firstName = tokens.firstName || \"\";\n    const lastName = tokens.lastName || \"\";\n    const fullName = [firstName, lastName].filter(Boolean).join(\" \").trim();\n    return {\n      accessToken: tokens.access_token,\n      refreshToken: tokens.refresh_token,","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/providers/cline.ts#L42-L78","documentation":"Error \"Cline token exchange failed: ${error}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/providers/cline.ts:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}