mirror of
https://github.com/outline/outline.git
synced 2026-11-25 07:04:37 +03:00
Respond to slack url verification challenge with JSON instead of raw body
This commit is contained in:
1 parent
d5158f0a34
commit
785b9888dd
1 file changed
+7
-1
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user