prod124njac/prod124njac-back-b/authsec_node/Backend/routes/user.router.js

32 lines
877 B
JavaScript
Raw Normal View History

2024-09-18 04:14:45 +00:00
const {
getUsers,
getUsersByUserId,
updateUsers,
deleteUsers,
login,
registerUser,
verifyOTP,
} = require("../api/user.controller")
const { checkToken } = require("../auth/token_validation")
const router = require("express").Router()
// router.get("/", checkToken, getUsers)
// router
// .get("/:id", checkToken, getUsersByUserId)
// .patch("/:id", checkToken, updateUsers)
// .delete("/:id", checkToken, deleteUsers)
// router.post("/login", login)
// router.post("/register", registerUser).post("/verify", verifyOTP)
router.get("/", checkToken, getUsers)
router
.get("/:id", checkToken, getUsersByUserId)
.patch("/:id", checkToken, updateUsers)
.delete("/:id", checkToken, deleteUsers)
router.post("/token/session", login)
// router.post("/login", login)
router.post("/register", registerUser).post("/verify", verifyOTP)
module.exports = router