Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update signature

Kiran Kc912ae08719a
diff --git a/apps/web/lib/webhook/signature.ts b/apps/web/lib/webhook/signature.ts
index 7aadb69445..3668f97a16 100644
--- a/apps/web/lib/webhook/signature.ts
+++ b/apps/web/lib/webhook/signature.ts
@@ -5,5 +5,8 @@ export const createWebhookSignature = (secret: string, rawBody: any) => {
throw new Error("A secret must be provided to create a webhook signature.");
}
- return crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
+ return crypto
+ .createHmac("sha256", secret)
+ .update(JSON.stringify(rawBody))
+ .digest("hex");
};