{"record":{"id":"01ea858320271b8b","repo":"medusajs/medusa","slug":"user-id-not-found","errorCode":null,"errorMessage":"User ID not found","messagePattern":"User ID not found","errorType":"exception","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/users/me/route.ts","lineNumber":20,"sourceCode":"  AuthenticatedMedusaRequest,\n  MedusaResponse,\n} from \"@medusajs/framework/http\"\nimport { HttpTypes } from \"@medusajs/framework/types\"\nimport {\n  ContainerRegistrationKeys,\n  MedusaError,\n  remoteQueryObjectFromString,\n} from \"@medusajs/framework/utils\"\n\nexport const GET = async (\n  req: AuthenticatedMedusaRequest<HttpTypes.AdminUserParams>,\n  res: MedusaResponse<HttpTypes.AdminUserResponse>\n) => {\n  const id = req.auth_context.actor_id\n  const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)\n\n  if (!id) {\n    throw new MedusaError(MedusaError.Types.NOT_FOUND, `User ID not found`)\n  }\n\n  const query = remoteQueryObjectFromString({\n    entryPoint: \"user\",\n    variables: { id },\n    fields: req.queryConfig.fields,\n  })\n\n  const [user] = await remoteQuery(query)\n\n  if (!user) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `User with id: ${id} was not found`\n    )\n  }\n\n  res.status(200).json({ user })","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/users/me/route.ts#L2-L38","documentation":"Thrown by GET /admin/users/me when the auth context carries no actor_id. Indicates the request is authenticated but not linked to a user actor.","triggerScenarios":"Calling /admin/users/me with a token whose auth_context has no actor_id (e.g. a third-party service token or incomplete auth registration).","commonSituations":"Using a JWT minted before the user was fully registered; authenticating with a provider that created an auth identity but no user; custom auth flows that skip actor linking.","solutions":["Ensure the auth identity is associated with a user (complete registration/login flow)","Re-issue the token after the user is created and linked","Check custom auth provider callbacks set actor_id correctly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const hasActorId = (ctx: {actor_id?: string|null}): ctx is {actor_id: string} => typeof ctx.actor_id === 'string' && ctx.actor_id.length > 0","tryCatchPattern":"catch (e) { if (e.type === 'not_found') forceReauth() }","preventionTips":["Decode the JWT and assert actor_id before calling /me","Re-login after registration flows"],"tags":["auth","users","actor","not-found"],"backgroundTag":"missing-auth-actor","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}