You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB
JavaScript

// Dependencies and Modules
const express = require('express');
const userController = require('../controllers/user');
console.log(userController);
// Routing Component
const router = express.Router();
// Auth import
const auth = require('../auth')
// Auth
const {verify,verifyAdmin} = auth;
// verifyng
router.post('/checkEmail', (req,res)=>{
userController.checkEmailExists(req.body).then(resultFromController => res.send(resultFromController));
});
// new routes
// Route for user Registration
router.post("/register", (req, res) => {
userController.registerUser(req.body).then(resultFromController => res.send(resultFromController));
});
// Route for user authenctication for log in
router.post("/login", userController.loginUser);
// Route for retrieving user details
// router.get("/details", verify, userController.getProfile);
// // Autentication import
// router.post("/enroll", verify, userController.enroll);
// router.get("/getEnrollments", verify, userController.getEnrollments);
// router.post("/updateProfile", verify, userController.updateProfile);
// router.post('/reset-password', verify, userController.resetPassword);
// router.put('/profile', verify, userController.updateProfile);
// router.post("/resetPassword", verify, userController.resetPassword);
// router.put('/profile', verify, userController.updateProfile);
// router.put('/updateEnrollmentStatus', verify, verifyAdmin, userController.updateEnrollmentStatus);
// router.put('/updateUserAsAdmin', verify, verifyAdmin, userController.updateUserAsAdmin);
module.exports = router;