itizawa 4 年之前
父節點
當前提交
d4186290cc
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/server/routes/apiv3/slack-integration.js

+ 2 - 2
src/server/routes/apiv3/slack-integration.js

@@ -25,13 +25,13 @@ module.exports = (crowi) => {
       return res.status(400).send({ message });
       return res.status(400).send({ message });
     }
     }
 
 
-    const slackAppIntegration = await SlackAppIntegration.findOne({ tokenPtoG });
+    const slackAppIntegrationCount = await SlackAppIntegration.estimatedDocumentCount({ tokenPtoG });
 
 
     logger.debug('verifyAccessTokenFromProxy', {
     logger.debug('verifyAccessTokenFromProxy', {
       tokenPtoG,
       tokenPtoG,
     });
     });
 
 
-    if (slackAppIntegration == null) {
+    if (slackAppIntegrationCount === 0) {
       return res.status(403).send({
       return res.status(403).send({
         message: 'The access token that identifies the request source is slackbot-proxy is invalid. Did you setup with `/growi register`?',
         message: 'The access token that identifies the request source is slackbot-proxy is invalid. Did you setup with `/growi register`?',
       });
       });