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'];
   const timestamp = req.headers['x-slack-request-timestamp'];
 
 
   if (slackSignature == null || timestamp == null) {
   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
   // protect against replay attacks