authenticateToken
This commit is contained in:
parent
35ca5e7e45
commit
12dc986941
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import { create, login, logout, getAll, deleteHandler } from '../controllers/UserController';
|
import { create, login, logout, getAll, deleteHandler } from '../controllers/UserController';
|
||||||
import { isValidCreateUser, isValidLogin } from '../middlewares/usersResourceValidation';
|
import { isValidCreateUser, isValidLogin } from '../middlewares/usersResourceValidation';
|
||||||
|
import { authenticateToken } from '../middlewares/checkAuth';
|
||||||
|
|
||||||
const userRouter = express.Router();
|
const userRouter = express.Router();
|
||||||
|
|
||||||
|
@ -8,6 +9,6 @@ userRouter.post('/', isValidCreateUser, create);
|
||||||
userRouter.get('/', getAll);
|
userRouter.get('/', getAll);
|
||||||
userRouter.post('/login', isValidLogin, login);
|
userRouter.post('/login', isValidLogin, login);
|
||||||
userRouter.post('/logout', logout);
|
userRouter.post('/logout', logout);
|
||||||
userRouter.delete('/:id', deleteHandler)
|
userRouter.delete('/:id', authenticateToken ,deleteHandler)
|
||||||
|
|
||||||
export default userRouter;
|
export default userRouter;
|
Loading…
Reference in a new issue