const express = require("express");
const { AuthController } = require("../../controllers/web");
const { verifySession } = require("../../middleware");
const router = express.Router();

router.get("/login", AuthController.index);
router.post("/loginProcess", AuthController.loginProcess);
router.post("/checkUserName", AuthController.checkUserName);
router.post("/registerProcess", AuthController.registerProcess);
router.get("/register", AuthController.register);
router.get("/logout", verifySession, AuthController.logout);
router.get("/forget-password", AuthController.forgetPassword);
router.post("/forgetPasswordProcess", AuthController.forgetPasswordProcess);
router.get("/confirm-password/:code", AuthController.confirmPassword);
router.post("/confirmPasswordProcess", AuthController.confirmPasswordProcess);
router.post(
  "/setLocationOfUserInSession",
  AuthController.setLocationOfUserInSession
);

router.get("/auth/google", AuthController.googleLogin);
router.get("/auth/google/callback", AuthController.googleCallback);

module.exports = router;
