const express = require("express");
const { AuthController } = require("../../controllers/api");
const {
  RegisterValidation,
  LoginValidation,
  ForgetPasswordValidation,
  SocialAuthenticationValidation,
  SendOTPValidation,
  VerifyOTPValidation,
} = require("../../validations/AuthValidation");
const { verifyToken } = require("../../middleware");
const router = express.Router();

router.post("/register", RegisterValidation, AuthController.register);
router.post("/updateDetails", RegisterValidation, AuthController.updateDetail);
router.post("/sendOTP", SendOTPValidation, AuthController.sendOtp);
router.post("/verifyOTP", VerifyOTPValidation, AuthController.verifyOtp);
router.post("/changePassword", verifyToken, AuthController.changePassword);
router.post(
  "/socialAuthentication",
  SocialAuthenticationValidation,
  AuthController.socialAuthentication
);
router.post("/login", LoginValidation, AuthController.login);
router.get("/checkUserName/:userName", AuthController.checkUserName);
router.post(
  "/forgetPassword",
  ForgetPasswordValidation,
  AuthController.forgetPasswordProcess
);

module.exports = router;
