fix: update prefix to cal_

pull/9078/head
Agusti Fernandez Pardo 2022-04-14 21:46:26 +02:00
parent 1405f7a861
commit 187b97afa1
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
API_KEY_PREFIX=pt_secret_
API_KEY_PREFIX=cal_

View File

@ -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