{"record":{"id":"e93624385976aef5","repo":"diegosouzapw/OmniRoute","slug":"path-unavailable","errorCode":"path_unavailable","errorMessage":"Claude auth path could not be resolved","messagePattern":"Claude auth path could not be resolved","errorType":"exception","errorClass":"ClaudeAuthFileError","httpStatus":500,"severity":"error","filePath":"src/lib/oauth/utils/claudeAuthFile.ts","lineNumber":275,"sourceCode":"    connectionId,\n    connectionLabel,\n    email,\n    fileName,\n    payload,\n    content,\n  };\n}\n\nexport async function writeClaudeAuthFileToLocalCli(connectionId: string) {\n  const built = await buildClaudeAuthFile(connectionId);\n  const paths = getCliConfigPaths(\"claude\");\n  // authPath is sourced exclusively from the static CLI_TOOLS table in\n  // src/shared/services/cliRuntime.ts (joined against os.homedir() inside\n  // that helper). No external/user input ever reaches the path APIs below.\n  const authPath = paths?.auth;\n\n  if (!authPath) {\n    throw new ClaudeAuthFileError(\n      \"Claude auth path could not be resolved\",\n      500,\n      \"path_unavailable\"\n    );\n  }\n\n  const authDir = path.dirname(authPath);\n  await fs.mkdir(authDir, { recursive: true });\n\n  // Side-by-side .bak inside the .claude directory for one-click manual\n  // rollback. Both halves are server-controlled (authDir from the static\n  // CLI_TOOLS table; basename from a server-generated ISO timestamp), so\n  // string concatenation here is safe — and avoids the false-positive\n  // taint on path.join when Semgrep cannot follow the trust chain.\n  let savedBakPath: string | null = null;\n  try {\n    await fs.access(authPath);\n    const ts = new Date().toISOString().replace(/[:.]/g, \"-\");","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/claudeAuthFile.ts#L257-L293","documentation":"Error \"Claude auth path could not be resolved\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/claudeAuthFile.ts:275 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"}