From 52515969f457b8b8e48f9264c92076a227019126 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 30 Aug 2024 15:08:37 +0200 Subject: [PATCH] TOKEN TESTING FIXED --- aksel.nav.no/website/pages/api/token-test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aksel.nav.no/website/pages/api/token-test.ts b/aksel.nav.no/website/pages/api/token-test.ts index 340cb0a40e..3d36cd47c7 100644 --- a/aksel.nav.no/website/pages/api/token-test.ts +++ b/aksel.nav.no/website/pages/api/token-test.ts @@ -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}`, });