make verifyApiKey not apply in docs
parent
09d8b48ccc
commit
e251fccb61
|
@ -14,7 +14,7 @@ const today = new Date();
|
|||
// This verifies the API key and sets the user if it is valid.
|
||||
export const verifyApiKey: NextMiddleware = async (req, res, next) => {
|
||||
const pathIsDocs = req.url?.startsWith("/docs");
|
||||
if (pathIsDocs) await next()
|
||||
if (pathIsDocs) await 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 || "cal_", "");
|
||||
|
|
Loading…
Reference in New Issue