Skip to content

Commit

Permalink
[C] add debug to revalidate
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed May 23, 2024
1 parent cc2d122 commit 30dfd0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pages/api/revalidate.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/* eslint-disable no-console */
import { isCraftPreview } from "@/helpers";

async function handler(req, res) {
const { query } = req;
const isPreview = isCraftPreview(query);

console.debug({
serverToken: process.env.CRAFT_REVALIDATE_SECRET_TOKEN,
receivedToken: query.secret,
});

if (isPreview) {
return res.status(401).json({
message:
Expand Down

0 comments on commit 30dfd0e

Please sign in to comment.