Skip to content

Commit

Permalink
aaaaaaaaaa i forgot config
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhb committed Dec 24, 2020
1 parent b6ec72c commit cc80db9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ export function verifySignature(req: NextApiRequest): boolean {
return false;
}
let rawBody = (req as unknown as { rawBody: string }).rawBody;
if (!rawBody || rawBody.length <= 0) {
rawBody = JSON.stringify(req.body);
}
// if (!rawBody || rawBody.length <= 0) {
// rawBody = JSON.stringify(req.body);
// }
const sig_base = 'v0:' + timestamp + ':' + rawBody;
const my_sig = 'v0=' + crypto.createHmac('sha256', slack_signing_secret)
.update(sig_base)
Expand Down
12 changes: 7 additions & 5 deletions pages/api/emoji_suggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import { NextApiRequest, NextApiResponse } from "next";

import emojis from 'emojis-keywords';
import { setupMiddlewares, verifySignature, web, withTimeout } from "../../lib/main";
import { api_config, setupMiddlewares, verifySignature, web, withTimeout } from "../../lib/main";

export const config = api_config;

interface BlockSuggestionInteraction {
type: 'block_suggestion';
Expand All @@ -32,10 +34,10 @@ interface BlockSuggestionInteraction {
// it unnecessary as well :)
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
await setupMiddlewares(req, res);
console.log(`Rawbody=`);
console.log((req as unknown as { rawBody: string }).rawBody);
console.log(`Body=`);
console.log(JSON.stringify(req.body));
// console.log(`Rawbody=`);
// console.log((req as unknown as { rawBody: string }).rawBody);
// console.log(`Body=`);
// console.log(JSON.stringify(req.body));
// console.log(`Setup middlewares`);
// res.writeHead(204).end();
// return;
Expand Down

1 comment on commit cc80db9

@vercel
Copy link

@vercel vercel bot commented on cc80db9 Dec 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.