itizawa 4 лет назад
Родитель
Сommit
3ec39446a8

+ 0 - 2
packages/slack/src/interfaces/request-between-growi-and-proxy.ts

@@ -6,8 +6,6 @@ export type RequestFromGrowi = Request & {
 
   // will be extracted from header
   tokenGtoPs: string[],
-
-  tokenGtoP: string,
 };
 
 export type RequestFromProxy = Request & {

+ 0 - 7
packages/slack/src/middlewares/verify-growi-to-slack-request.ts

@@ -10,13 +10,6 @@ const logger = loggerFactory('@growi/slack:middlewares:verify-slack-request');
  * See: https://api.slack.com/authentication/verifying-requests-from-slack
  */
 export const verifyGrowiToSlackRequest = (req: RequestFromGrowi, res: Response, next: NextFunction): Record<string, any> | void => {
-  // If it is single, set it and next.
-  const token = req.headers['x-growi-gtop-token'];
-  if (token != null) {
-    req.tokenGtoP = token as string;
-    return next();
-  }
-
   const str = req.headers['x-growi-gtop-tokens'];
 
   if (str == null) {

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

@@ -107,7 +107,7 @@ module.exports = (crowi) => {
 
     const result = await axios.get(urljoin(proxyUri, '/g2s/relation-test'), {
       headers: {
-        'x-growi-gtop-token': token,
+        'x-growi-gtop-tokens': token,
       },
     });
 
@@ -452,7 +452,8 @@ module.exports = (crowi) => {
    *           200:
    *             description: Succeeded to delete botType setting.
    */
-  router.post('/with-proxy/relation-test', loginRequiredStrictly, adminRequired, csrf, validator.RelationTest, apiV3FormValidator, async(req, res) => {
+  //  loginRequiredStrictly, adminRequired, csrf, validator.RelationTest, apiV3FormValidator,
+  router.post('/with-proxy/relation-test', async(req, res) => {
     const currentBotType = crowi.configManager.getConfig('crowi', 'slackbot:currentBotType');
     if (currentBotType === 'customBotWithoutProxy') {
       const msg = 'Not Proxy Type';