Skip to content

Commit

Permalink
fix interactive message verification
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinr committed Jul 12, 2017
1 parent 0f28e9d commit eba4b4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ app.post('/events', (req, res) => {
* verification token before continuing.
*/
app.post('/interactive-message', (req, res) => {
if (req.body.token === process.env.SLACK_VERIFICATION_TOKEN) {
const { token, user, team } = JSON.parse(req.body.payload);
if (token === process.env.SLACK_VERIFICATION_TOKEN) {
// simplest case with only a single button in the application
// check `callback_id` and `value` if handling multiple buttons
const { user, team } = JSON.parse(req.body.payload);
onboard.accept(user.id, team.id);
res.send({ text: 'Thank you! The Terms of Service have been accepted.' });
} else { res.sendStatus(500); }
Expand Down

0 comments on commit eba4b4f

Please sign in to comment.