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.

fix the signature

Kiran Kd0f54a37f231
diff --git a/apps/web/lib/webhook/publish.ts b/apps/web/lib/webhook/publish.ts
index 16cf545544..65088890f1 100644
--- a/apps/web/lib/webhook/publish.ts
+++ b/apps/web/lib/webhook/publish.ts
@@ -4,7 +4,7 @@ import { Webhook } from "@prisma/client";
import { WebhookTrigger } from "../types";
import { clickEventSchemaTB } from "../zod/schemas/clicks";
import { LinkSchema } from "../zod/schemas/links";
-import { createWebhookSignature } from "./signature";
+import { createWebhookSignature } from "./utils";
interface SendToWebhookArgs {
webhookUrl?: string;
diff --git a/apps/web/lib/webhook/signature.ts b/apps/web/lib/webhook/utils.ts
similarity index 87%
rename from apps/web/lib/webhook/signature.ts
rename to apps/web/lib/webhook/utils.ts
index 3668f97a16..ec72c68f59 100644
--- a/apps/web/lib/webhook/signature.ts
+++ b/apps/web/lib/webhook/utils.ts
@@ -1,5 +1,6 @@
import crypto from "crypto";
+// Create a signature for a webhook request
export const createWebhookSignature = (secret: string, rawBody: any) => {
if (!secret) {
throw new Error("A secret must be provided to create a webhook signature.");