mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-24 02:39:19 -05:00
fix: remove registration endpoint from authentication bypass in middleware (#267)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user