fix: convert polar_whs_ prefix to whsec_ for svix compatibility
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user