From 0f28e9d260c2102055c2528a350013cf15a00729 Mon Sep 17 00:00:00 2001 From: Sachin Ranchod Date: Tue, 11 Jul 2017 09:42:48 -0700 Subject: [PATCH] fix json body parsing --- src/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index a67319a..0d04c75 100644 --- a/src/index.js +++ b/src/index.js @@ -32,8 +32,7 @@ app.post('/events', (req, res) => { break; } case 'event_callback': { - const body = JSON.parse(req.body.payload); - if (body.token === process.env.SLACK_VERIFICATION_TOKEN) { + if (req.body.token === process.env.SLACK_VERIFICATION_TOKEN) { const event = req.body.event; // `team_join` is fired whenever a new user (incl. a bot) joins the team