Browse Source

clean code

itizawa 4 years ago
parent
commit
ae1ade7fb0
1 changed files with 2 additions and 5 deletions
  1. 2 5
      src/server/routes/apiv3/slack-integration.js

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

@@ -14,17 +14,14 @@ module.exports = (crowi) => {
 
   // Check if the access token is correct
   async function verifyAccessTokenFromProxy(req, res, next) {
-    const token = req.headers['x-growi-ptog-tokens'];
+    const tokenPtoG = req.headers['x-growi-ptog-tokens'];
 
-    if (token == null) {
+    if (tokenPtoG == null) {
       const message = 'The value of header \'x-growi-ptog-tokens\' must not be empty.';
       logger.warn(message, { body: req.body });
       return res.status(400).send({ message });
     }
 
-    const { body } = req;
-    const { tokenPtoG } = body;
-
     const correctToken = configManager.getConfig('crowi', 'slackbot:access-token');
 
     logger.debug('verifyAccessTokenFromProxy', {