{"record":{"id":"a3bac724d4a12b0c","repo":"calcom/cal.diy","slug":"no-credential-found-for-user-a3bac7","errorCode":null,"errorMessage":"No credential found for user","messagePattern":"No credential found for user","errorType":"http","errorClass":"HttpError","httpStatus":403,"severity":"warning","filePath":"packages/app-store/basecamp3/api/projects.ts","lineNumber":26,"sourceCode":"import prisma from \"@calcom/prisma\";\nimport { credentialForCalendarServiceSelect } from \"@calcom/prisma/selects/credential\";\nimport { HttpError } from \"@calcom/lib/http-error\";\n\nasync function handler(req: NextApiRequest) {\n  const userId = req.session?.user?.id;\n  if (!userId) {\n    throw new HttpError({ statusCode: 401, message: \"Unauthorized\" });\n  }\n\n  const { user_agent } = await getAppKeysFromSlug(\"basecamp3\");\n\n  const credential = await prisma.credential.findFirst({\n    where: { userId },\n    select: credentialForCalendarServiceSelect,\n  });\n\n  if (!credential) {\n    throw new HttpError({ statusCode: 403, message: \"No credential found for user\" });\n  }\n\n  let credentialKey = credential.key as BasecampToken;\n\n  if (!credentialKey.account) {\n    return { currentProject: null, projects: [] };\n  }\n\n  if (credentialKey.expires_at < Date.now()) {\n    credentialKey = (await refreshAccessToken(credential)) as BasecampToken;\n  }\n\n  const url = `${credentialKey.account.href}/projects.json`;\n  const resp = await fetch(url, {\n    headers: { \"User-Agent\": user_agent as string, Authorization: `Bearer ${credentialKey.access_token}` },\n  });\n\n  if (!resp.ok) {","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/packages/app-store/basecamp3/api/projects.ts#L8-L44","documentation":"Thrown by the Basecamp 3 projects listing handler when the authenticated user has no Basecamp 3 credential row. Without the OAuth token the handler cannot list projects. Surfaced as HTTP 403. Same precondition as the projectMutation endpoint.","triggerScenarios":"User navigates to the Basecamp settings before completing OAuth connect; the credential was deleted; a different user account without a Basecamp connection.","commonSituations":"User skipped the connect step; uninstall cleared the credential; multiple accounts where the active one lacks the credential.","solutions":["Complete the Basecamp 3 OAuth connect flow first.","Verify a credential row exists for the user before rendering the projects UI.","Re-install the Basecamp 3 app if it was removed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const credential = await prisma.credential.findFirst({\n  where: { userId },\n  select: credentialForCalendarServiceSelect,\n});\nif (!credential) {\n  // prompt the user to connect Basecamp before listing projects\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Complete Basecamp 3 OAuth connect before listing projects.","Gate the projects UI on the presence of a credential row.","Re-install Basecamp 3 if it was removed."],"tags":["basecamp3","credential","missing-credential","oauth"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}