From 187b97afa169f61511cbce4e75e1c6affab56f17 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Thu, 14 Apr 2022 21:46:26 +0200 Subject: [PATCH] fix: update prefix to cal_ --- .env.example | 2 +- lib/helpers/verifyApiKey.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 038c1ebd26..f3271e560c 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -API_KEY_PREFIX=pt_secret_ \ No newline at end of file +API_KEY_PREFIX=cal_ \ No newline at end of file diff --git a/lib/helpers/verifyApiKey.ts b/lib/helpers/verifyApiKey.ts index 9986707884..6fe33c6ad3 100644 --- a/lib/helpers/verifyApiKey.ts +++ b/lib/helpers/verifyApiKey.ts @@ -15,7 +15,7 @@ const today = new Date(); export const verifyApiKey: NextMiddleware = async (req, res, next) => { if (!req.query.apiKey) res.status(401).json({ message: "No API key provided" }); - const strippedApiKey = `${req.query.apiKey}`.replace(process.env.API_KEY_PREFIX || "pt_secret_", ""); + const strippedApiKey = `${req.query.apiKey}`.replace(process.env.API_KEY_PREFIX || "cal_", ""); const hashedKey = hashAPIKey(strippedApiKey); await prisma.apiKey