diff --git a/backend/controllers/middlewares/Auth.js b/backend/controllers/middlewares/Auth.js index c40a4c7f..0fd2cb8d 100644 --- a/backend/controllers/middlewares/Auth.js +++ b/backend/controllers/middlewares/Auth.js @@ -9,7 +9,7 @@ const createToken = (user) => { const validateToken = (req, res, next) => { - if (req.path === '/register' && req.method === 'POST') { + if (req.path === '/auth/register' && req.method === 'POST') { return next(); } diff --git a/backend/index.js b/backend/index.js index 63240aa5..276eace6 100644 --- a/backend/index.js +++ b/backend/index.js @@ -11,7 +11,7 @@ const port = 3001; app.use(express.json()); app.use(validateToken); -app.use(userRoute); +app.use('/auth', userRoute); app.use('/elective', electiveRoute); app.use('/learning_paths', learningPathRoute);