Validate hookdeck webhooks
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { get } from "radash";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
await validateHookdeck(event);
|
||||
|
||||
const config = useRuntimeConfig();
|
||||
const body = await readBody(event);
|
||||
|
||||
const aspectType = get(body, "aspect_type");
|
||||
@@ -9,5 +12,8 @@ export default defineEventHandler(async (event) => {
|
||||
await $fetch(`/webhooks/strava/${objectType}-${aspectType}`, {
|
||||
method: "post",
|
||||
body,
|
||||
headers: {
|
||||
"X-Hookdeck-Key": config.hookdeckKey,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user