Slack Signature Verification (#2667)

* Slack Verify

* Adding await

* Update slackVerify.ts

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
This commit is contained in:
sean-brydon
2022-05-03 23:40:01 +00:00
committed by GitHub
co-authored by kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> zomars
parent 02b935bcde
commit fa1ca5fba0
3 changed files with 40 additions and 1 deletions
@@ -2,6 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { showCreateEventMessage, showTodayMessage } from "../lib";
import showLinksMessage from "../lib/showLinksMessage";
import slackVerify from "../lib/slackVerify";
export enum SlackAppCommands {
CREATE_EVENT = "create-event",
@@ -12,7 +13,7 @@ export enum SlackAppCommands {
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === "POST") {
const command = req.body.command.split("/").pop();
await slackVerify(req, res);
switch (command) {
case SlackAppCommands.CREATE_EVENT:
return await showCreateEventMessage(req, res);