Browse Source

add a todo comment

kaori 5 years ago
parent
commit
a81e662b3e
1 changed files with 7 additions and 2 deletions
  1. 7 2
      packages/slackbot-proxy/src/controllers/slack.ts

+ 7 - 2
packages/slackbot-proxy/src/controllers/slack.ts

@@ -94,7 +94,12 @@ export class SlackCtrl {
   }
   }
 
 
   @Post('/interactions')
   @Post('/interactions')
-  async handleInteraction(@BodyParams() body:{[key:string]:string}, @Res() res: Res): Promise<void|string> {
+  // TODO: using new middleware (5789 blocking)
+  // ~~@UseBefore(AuthorizeMiddleware)~~
+  async handleInteraction(@Req() req: AuthedReq, @Res() res: Res): Promise<void|string> {
+    const { body, authorizeResult } = req;
+    console.log('authorizeResult', authorizeResult);
+
     logger.info('receive interaction', body);
     logger.info('receive interaction', body);
 
 
     const installation = await this.installationRepository.findByID('1');
     const installation = await this.installationRepository.findByID('1');
@@ -149,7 +154,7 @@ export class SlackCtrl {
       return 'No text.';
       return 'No text.';
     }
     }
 
 
-    // Find the latest order by installationId
+    // Find the latest order by installationId and GROWIurl
     let order = await this.orderRepository.findOne({
     let order = await this.orderRepository.findOne({
       installation: installation.id,
       installation: installation.id,
     }, {
     }, {