Skip to content

Commit

Permalink
TOKEN TESTING FIXED
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Aug 30, 2024
1 parent 0a885f7 commit 5251596
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aksel.nav.no/website/pages/api/token-test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { NextApiRequest, NextApiResponse } from "next";

export default async function test(req: NextApiRequest, res: NextApiResponse) {
if (process.env.SANITY_PREVIEW_TOKEN) {
return res.status(200).json({ message: "Found token preview" });
}

/* This keys is only for testing and will not compromise anything if leaked! */
if (process.env.sanity_demo_key) {
if (process.env.SANITY_PREVIEW_TOKEN) {
return res.status(200).json({
message: `Found token demo-key : ${process.env.sanity_demo_key} + sanity tokens`,
});
}
return res.status(200).json({
message: `Found token demo-key : ${process.env.sanity_demo_key}`,
});
Expand Down

0 comments on commit 5251596

Please sign in to comment.