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

32 lines
877 B
JavaScript
Raw Normal View History

2024-09-16 05:00:58 +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