Skip to content

Commit

Permalink
debug/log sb revalidate request data
Browse files Browse the repository at this point in the history
  • Loading branch information
dogfrogfog committed Oct 30, 2024
1 parent 72315a9 commit d92df34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/storyblok/src/app/api/revalidate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export async function POST(request: Request) {
const { searchParams } = new URL(request.url);
const secret = searchParams.get("secret");

console.log("secret: ", secret, process.env.SB_WEBHOOK_REVALIDATE_SECRET);
console.log("body: ", body);

if (!body) {
return Response.json({ error: "No body provided" }, { status: 400 });
}
Expand All @@ -26,6 +29,8 @@ export async function POST(request: Request) {
pagePath = result?.replace("(", "")?.replace(")", "");
}

console.log("pagePath: ", pagePath);

if (secret !== process.env.SB_WEBHOOK_REVALIDATE_SECRET) {
return Response.json({ error: "No secret provided" }, { status: 400 });
}
Expand Down

0 comments on commit d92df34

Please sign in to comment.