|
|
@@ -1,12 +1,15 @@
|
|
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
|
import { stringify } from 'qs';
|
|
|
-
|
|
|
-
|
|
|
+import {Request, Response, NextFunction} from 'express'
|
|
|
/**
|
|
|
* Verify if the request came from slack
|
|
|
* See: https://api.slack.com/authentication/verifying-requests-from-slack
|
|
|
*/
|
|
|
-export const verifyingIsSlackRequest = (req, res, next):string => {
|
|
|
+interface signingSecret extends Request{
|
|
|
+ signingSecret: string
|
|
|
+}
|
|
|
+
|
|
|
+export const verifyingIsSlackRequest = (req: Request & {signingSecret?:string}, res: Response, next: NextFunction) => {
|
|
|
|
|
|
if (req.signingSecret == null) {
|
|
|
return res.send('No signing secret.');
|