Yuki Takei 5 years ago
parent
commit
df9c90403d

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

@@ -43,14 +43,14 @@ export class SlackCtrl {
   }
   }
 
 
   @Get('/oauth_redirect')
   @Get('/oauth_redirect')
-  handleOauthRedirect(@Req() req: Req, @Res() res: Res): void {
+  async handleOauthRedirect(@Req() req: Req, @Res() res: Res): Promise<void> {
     // illegal state
     // illegal state
     // TODO: https://youtrack.weseek.co.jp/issue/GW-5543
     // TODO: https://youtrack.weseek.co.jp/issue/GW-5543
     if (req.query.state === '') {
     if (req.query.state === '') {
       throw new Error('illegal state');
       throw new Error('illegal state');
     }
     }
 
 
-    this.installerService.installer.handleCallback(req, res);
+    return this.installerService.installer.handleCallback(req, res);
 
 
     // TODO: https://youtrack.weseek.co.jp/issue/GW-5543
     // TODO: https://youtrack.weseek.co.jp/issue/GW-5543
     // this.installer.handleCallback(req, res, {
     // this.installer.handleCallback(req, res, {

+ 2 - 1
packages/slackbot-proxy/src/services/InstallerService.ts

@@ -6,6 +6,7 @@ import { Service } from '@tsed/di';
 
 
 const installationStore: InstallationStore = {
 const installationStore: InstallationStore = {
   storeInstallation: async(installation: Installation<'v1' | 'v2', boolean>) => {
   storeInstallation: async(installation: Installation<'v1' | 'v2', boolean>) => {
+    console.log({ installation });
   },
   },
   fetchInstallation: async(installQuery: InstallationQuery<boolean>) => {
   fetchInstallation: async(installQuery: InstallationQuery<boolean>) => {
     const installation: Installation<'v1' | 'v2', boolean> = {
     const installation: Installation<'v1' | 'v2', boolean> = {
@@ -42,7 +43,7 @@ export class InstallerService {
       clientId,
       clientId,
       clientSecret,
       clientSecret,
       stateSecret,
       stateSecret,
-      // installationStore,
+      installationStore,
     });
     });
   }
   }