From 00a939695e88560346a4b3767deab0c25851f2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Yoshida?= Date: Tue, 21 Nov 2023 22:21:38 -0300 Subject: [PATCH] =?UTF-8?q?[FIX]:=20erro=20de=20autentica=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/controllers/middlewares/Auth.js | 2 +- backend/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);