From 604fe4f71d2938ef9d82cd991b731237bccb7b69 Mon Sep 17 00:00:00 2001 From: samanhappy Date: Mon, 11 Aug 2025 14:18:28 +0800 Subject: [PATCH] fix: remove registration endpoint from authentication bypass in middleware (#267) --- src/middlewares/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/middlewares/index.ts b/src/middlewares/index.ts index a1dcc90..183f092 100644 --- a/src/middlewares/index.ts +++ b/src/middlewares/index.ts @@ -53,8 +53,8 @@ export const initMiddlewares = (app: express.Application): void => { // Protect API routes with authentication middleware, but exclude auth endpoints app.use(`${config.basePath}/api`, (req, res, next) => { - // Skip authentication for login and register endpoints - if (req.path === '/auth/login' || req.path === '/auth/register') { + // Skip authentication for login endpoint + if (req.path === '/auth/login') { next(); } else { // Apply authentication middleware first