diff --git a/server/routes/api/hooks.ts b/server/routes/api/hooks.ts index 8c1beb100..30d7e84e7 100644 --- a/server/routes/api/hooks.ts +++ b/server/routes/api/hooks.ts @@ -46,8 +46,14 @@ function verifySlackToken(token: string) { // triggered by a user posting a getoutline.com link in Slack router.post("hooks.unfurl", async (ctx: APIContext) => { const { challenge, token, event } = ctx.request.body; + + // See URL verification handshake documentation on this page: + // https://api.slack.com/apis/connections/events-api if (challenge) { - return (ctx.body = ctx.request.body.challenge); + ctx.body = { + challenge, + }; + return; } assertPresent(token, "token is required");