{"record":{"id":"d33689df5c7c0821","repo":"RocketChat/Rocket.Chat","slug":"no-token-d33689","errorCode":null,"errorMessage":"No token","messagePattern":"No token","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"apps/meteor/server/oauth2-server/oauth.ts","lineNumber":148,"sourceCode":"\t\t\t\treturn res.redirect('/oauth/error/invalid_redirect_uri');\n\t\t\t}\n\n\t\t\treturn next();\n\t\t});\n\n\t\tthis.app.post('/oauth/authorize', debugMiddleware, async (req, res, next) => {\n\t\t\tif (req.body.allow !== 'yes') {\n\t\t\t\tres.status(401);\n\t\t\t\treturn res.send({ error: 'access_denied', error_description: 'The user denied access to your application' });\n\t\t\t}\n\n\t\t\t// The new version of the library is expecting a new name. Doing this for compatibility\n\t\t\tif (req.body.token && !req.body.access_token) {\n\t\t\t\treq.body.access_token = req.body.token;\n\t\t\t}\n\n\t\t\tif (req.body.access_token == null) {\n\t\t\t\treturn res.status(401).send('No token');\n\t\t\t}\n\n\t\t\tconst user = await Users.findOne(\n\t\t\t\t{\n\t\t\t\t\t'services.resume.loginTokens.hashedToken': Accounts._hashLoginToken(req.body.access_token),\n\t\t\t\t},\n\t\t\t\t{ projection: { _id: 1 } },\n\t\t\t);\n\n\t\t\tif (user == null) {\n\t\t\t\treturn res.status(401).send('Invalid token');\n\t\t\t}\n\n\t\t\tres.locals.user = { id: user._id };\n\n\t\t\treturn next();\n\t\t});\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/oauth2-server/oauth.ts#L130-L166","documentation":"Error \"No token\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/oauth2-server/oauth.ts:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include a valid access_token (or legacy token) field in the POST body to /oauth/authorize.","Ensure the user is logged in and the client forwards their login token with the authorization request."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}