Skip to content

Commit

Permalink
fix json body parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinr committed Jul 11, 2017
1 parent 9ea0bd2 commit 0f28e9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f28e9d

Please sign in to comment.