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 route.ts

Kiran K812596dd10d1
diff --git a/apps/web/app/api/resend/webhook/route.ts b/apps/web/app/api/resend/webhook/route.ts
index 7d28e22a27..1d39b97885 100644
--- a/apps/web/app/api/resend/webhook/route.ts
+++ b/apps/web/app/api/resend/webhook/route.ts
@@ -22,12 +22,15 @@ export const POST = async (req: Request) => {
// Need to base64 decode the secret
const secretBytes = Buffer.from(secret.split("_")[1], "base64");
const computedSignature = crypto
- .createHmac("sha256", new Uint8Array(secretBytes))
+ .createHmac("sha256", secretBytes)
.update(signedContent)
.digest("base64");
if (computedSignature !== svixSignature) {
- return NextResponse.json({ message: "Invalid signature." }, { status: 400 });
+ return NextResponse.json(
+ { message: "Invalid signature." },
+ { status: 400 },
+ );
}
const { type, data } = JSON.parse(rawBody) || {};