fix: convert polar_whs_ prefix to whsec_ for svix compatibility

This commit is contained in:
kovakmedya
2026-05-04 18:52:55 +03:00
parent afbb029c67
commit 3986094bad
+3 -1
View File
@@ -59,7 +59,9 @@ export function verifyPolarWebhook(
): boolean {
if (!WEBHOOK_SECRET) return false;
try {
const wh = new Webhook(WEBHOOK_SECRET);
// Svix whsec_ prefix bekler; polar_whs_ → whsec_ dönüşümü
const secret = WEBHOOK_SECRET.replace(/^polar_whs_/, "whsec_");
const wh = new Webhook(secret);
wh.verify(rawBody, headers);
return true;
} catch {