{"record":{"id":"6fdb02fa4a96d9cb","repo":"diegosouzapw/OmniRoute","slug":"no-json-found-in-decoded-code","errorCode":null,"errorMessage":"No JSON found in decoded code","messagePattern":"No JSON found in decoded code","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/providers/cline.ts","lineNumber":31,"sourceCode":"  },\n  exchangeToken: async (config, code, redirectUri) => {\n    try {\n      // Cline embeds tokens as base64-encoded JSON in the auth code.\n      // The code may be URL-encoded when pasted from the callback URL.\n      let base64 = code;\n      try {\n        base64 = decodeURIComponent(base64);\n      } catch {\n        /* already decoded */\n      }\n      const padding = 4 - (base64.length % 4);\n      if (padding !== 4) {\n        base64 += \"=\".repeat(padding);\n      }\n      const decoded = Buffer.from(base64, \"base64\").toString(\"utf-8\");\n      const lastBrace = decoded.lastIndexOf(\"}\");\n      if (lastBrace === -1) {\n        throw new Error(\"No JSON found in decoded code\");\n      }\n      const jsonStr = decoded.substring(0, lastBrace + 1);\n      const tokenData = JSON.parse(jsonStr);\n      return {\n        access_token: tokenData.accessToken,\n        refresh_token: tokenData.refreshToken,\n        email: tokenData.email,\n        firstName: tokenData.firstName,\n        lastName: tokenData.lastName,\n        expires_at: tokenData.expiresAt,\n      };\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        },","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/providers/cline.ts#L13-L49","documentation":"Error \"No JSON found in decoded code\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/providers/cline.ts:31 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"}