diff --git a/src/routes/userRouter.ts b/src/routes/userRouter.ts index 77ae7e2..bbfd01a 100644 --- a/src/routes/userRouter.ts +++ b/src/routes/userRouter.ts @@ -1,6 +1,7 @@ import express from 'express'; import { create, login, logout, getAll, deleteHandler } from '../controllers/UserController'; import { isValidCreateUser, isValidLogin } from '../middlewares/usersResourceValidation'; +import { authenticateToken } from '../middlewares/checkAuth'; const userRouter = express.Router(); @@ -8,6 +9,6 @@ userRouter.post('/', isValidCreateUser, create); userRouter.get('/', getAll); userRouter.post('/login', isValidLogin, login); userRouter.post('/logout', logout); -userRouter.delete('/:id', deleteHandler) +userRouter.delete('/:id', authenticateToken ,deleteHandler) export default userRouter; \ No newline at end of file