add token speed block

This commit is contained in:
musistudio 2025-12-31 22:44:16 +08:00
parent e7073790b3
commit 10c69a586b
14 changed files with 900 additions and 369 deletions

View file

@ -4,7 +4,8 @@ export const apiKeyAuth =
(config: any) =>
async (req: FastifyRequest, reply: FastifyReply, done: () => void) => {
// Public endpoints that don't require authentication
if (["/", "/health"].includes(req.url) || req.url.startsWith("/ui")) {
const publicPaths = ["/", "/health"];
if (publicPaths.includes(req.url) || req.url.startsWith("/ui")) {
return done();
}