{"record":{"id":"731f6a5e313289d7","repo":"Mintplex-Labs/anything-llm","slug":"invalid-auth-token","errorCode":null,"errorMessage":"Invalid auth token.","messagePattern":"Invalid auth token\\.","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"server/utils/middleware/validatedRequest.js","lineNumber":87,"sourceCode":"\n  UserMetaCache.setFromRequest(request);\n  next();\n}\n\nasync function validateMultiUserRequest(request, response, next) {\n  const auth = request.header(\"Authorization\");\n  const token = auth ? auth.split(\" \")[1] : null;\n\n  if (!token) {\n    response.status(401).json({\n      error: \"No auth token found.\",\n    });\n    return;\n  }\n\n  const valid = decodeJWT(token);\n  if (!valid || !valid.id) {\n    response.status(401).json({\n      error: \"Invalid auth token.\",\n    });\n    return;\n  }\n\n  const user = await User.get({ id: valid.id });\n  if (!user) {\n    response.status(401).json({\n      error: \"Invalid auth for user.\",\n    });\n    return;\n  }\n\n  if (user.suspended) {\n    response.status(401).json({\n      error: \"User is suspended from system\",\n    });\n    return;","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/middleware/validatedRequest.js#L69-L105","documentation":"Auth guard in validateMultiUserRequest: a bearer token was supplied but decodeJWT returned an invalid payload without a user id, meaning the JWT is malformed, expired, or signed with the wrong secret, so the request is refused with 401.","triggerScenarios":"Invalid auth token presented. Triggered when the bearer token does not match or decode (validatedRequest.js:87).","commonSituations":"See trigger scenarios.","solutions":["Log in again to obtain a valid JWT for multi-user mode.","Check the token is sent as 'Bearer <token>' and JWT_SECRET matches the one that signed it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}