Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Fix "as RawRequest" for webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Feb 28, 2020
1 parent e14f9aa commit a0457fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staart/manager",
"version": "1.3.35",
"version": "1.3.36",
"main": "index.js",
"repository": "[email protected]:staart/api.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down Expand Up @@ -125,5 +125,5 @@
"setup"
],
"snyk": true,
"staart-version": "1.3.35"
"staart-version": "1.3.36"
}
4 changes: 2 additions & 2 deletions src/helpers/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const validator = (
* Handle Stripe's webhook authentication
*/
export const stripeWebhookAuthHandler = async (
req: RawRequest,
req: Request,
res: Response,
next: NextFunction
) => {
Expand All @@ -273,7 +273,7 @@ export const stripeWebhookAuthHandler = async (
return res.json(error);
}
try {
const event = constructWebhookEvent(req.rawBody, signature);
const event = constructWebhookEvent((req as RawRequest).rawBody, signature);
(res.locals as StripeLocals).stripeEvent = event;
next();
} catch (error) {
Expand Down

0 comments on commit a0457fd

Please sign in to comment.