浏览代码

add status

zahmis 5 年之前
父节点
当前提交
edebe1aa0c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/slack/src/middlewares/verification-slack-request.ts

+ 1 - 1
packages/slack/src/middlewares/verification-slack-request.ts

@@ -21,7 +21,7 @@ export const verificationSlackRequest = (req : Request & signingSecretType, res:
   const timestamp = req.headers['x-slack-request-timestamp'];
 
   if (slackSignature == null || timestamp == null) {
-    throw new Error('Verification failed.');
+    return res.status(401).send({ message: 'Unauthorized. Enter from Slack workspace' });
   }
 
   // protect against replay attacks