AdminCoursePage added..... admin routes protection added

This commit is contained in:
Harshitha Shetty
2025-03-29 15:40:41 +05:30
parent 19b94b1a9f
commit 9fda8ba883
10 changed files with 599 additions and 18 deletions

View File

@@ -121,4 +121,18 @@ router.post("/reset-password", async (req, res) => {
}
});
// router.get("/me", (req, res) => {
// try {
// const token = req.cookies.token;
// console.log("token recieved",token);
// if (!token) return res.status(401).json({ message: "Unauthorized" });
// const user = jwt.verify(token, process.env.JWT_SECRET);
// res.json(user);
// } catch (error) {
// res.status(401).json({ message: "Invalid token" });
// }
// });
module.exports = router;