{"record":{"id":"a5c78e16ee8d4638","repo":"diegosouzapw/OmniRoute","slug":"missing-access-token-a5c78e","errorCode":"missing_access_token","errorMessage":"accessToken is missing or empty in claudeAiOauth","messagePattern":"accessToken is missing or empty in claudeAiOauth","errorType":"exception","errorClass":"ClaudeAuthFileError","httpStatus":400,"severity":"error","filePath":"src/lib/oauth/utils/claudeAuthImport.ts","lineNumber":58,"sourceCode":"}\n\nexport interface CreateConnectionOptions {\n  name?: string;\n  email?: string;\n  overwriteExisting?: boolean;\n}\n\n// ──── Parse & validate ────────────────────────────────────────────────────────\n\nexport function parseAndValidateClaudeAuth(raw: unknown): ParsedClaudeAuth {\n  const doc = toRecord(raw);\n  const oauthBlock = toRecord(doc.claudeAiOauth);\n\n  const accessToken = toNonEmptyString(oauthBlock.accessToken);\n  const refreshToken = toNonEmptyString(oauthBlock.refreshToken);\n\n  if (!accessToken) {\n    throw new ClaudeAuthFileError(\n      \"accessToken is missing or empty in claudeAiOauth\",\n      400,\n      \"missing_access_token\"\n    );\n  }\n\n  if (!refreshToken) {\n    throw new ClaudeAuthFileError(\n      \"refreshToken is missing or empty in claudeAiOauth\",\n      400,\n      \"missing_refresh_token\"\n    );\n  }\n\n  // expiresAt in the file is ms epoch; store as ISO in DB\n  let expiresAt: string | null = null;\n  const rawExpiresAt = oauthBlock.expiresAt;\n  if (typeof rawExpiresAt === \"number\" && Number.isFinite(rawExpiresAt)) {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/claudeAuthImport.ts#L40-L76","documentation":"Error \"accessToken is missing or empty in claudeAiOauth\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/claudeAuthImport.ts:58 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"}