import express from 'express';
import cookieController from '../controllers/cookieController.js';
import userController from "../controllers/userController.js";
import {cryptoUtil} from "../util/cryptoUtil.js";
const router = express.Router();

router.get('/', cookieController.login);
router.get('/login', cookieController.login);
router.post('/login', userController.login);
router.get('/register', cookieController.register);
router.post('/register', userController.register);
router.get('/signout', userController.signout);
router.get('/dashboard', cryptoUtil.loggedIn, cookieController.dashboard);
//router.post('/dashboard', cryptoUtil.loggedIn, cookieController.dashboard);
router.get('/room', cryptoUtil.loggedIn, cookieController.room);
router.post('/room', cryptoUtil.loggedIn, cookieController.updateRoom);
router.get('/new-room', cryptoUtil.loggedIn, cookieController.newRoom);
router.post('/new-room', cryptoUtil.loggedIn, cookieController.newRoom);
router.post('/join-room', cryptoUtil.loggedIn, cookieController.joinRoom);


export default router;