kaori 4 years ago
parent
commit
0bce73b7ae

+ 3 - 3
packages/slackbot-proxy/src/controllers/growi-to-slack.ts

@@ -99,13 +99,13 @@ export class GrowiToSlackCtrl {
       return res.status(400).send({ message: 'order has expired or does not exist.' });
     }
 
-    // Try to access the GROWI registered in the Order record and check if the GtoP token is valid.
+    // Access the GROWI URL saved in the Order record and check if the GtoP token is valid.
     try {
       const url = new URL('/_api/v3/slack-integration/proxied/commands', order.growiUrl);
       await axios.post(url.toString(), {
-        tokenPtoG: order.growiAccessToken,
         type: 'url_verification',
-        challenge: 'url verification is successful',
+        tokenPtoG: order.growiAccessToken,
+        message: 'url verification was successful',
       });
     }
     catch (err) {

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

@@ -83,7 +83,7 @@ module.exports = (crowi) => {
     // eslint-disable-next-line max-len
     // see: https://api.slack.com/apis/connections/events-api#the-events-api__subscribing-to-event-types__events-api-request-urls__request-url-configuration--verification
     if (body.type === 'url_verification') {
-      return body.challenge;
+      return res.send({ message: body.message });
     }
 
     return handleCommands(req, res);