import express from 'express';
import { auth } from '../../middleware/auth';
import { login, signIn, getCurrentUser } from './controllers/auth';
import { validateRequest } from '../../middleware/validation/validateRequest';
import { loginSchema, signInSchema } from './validation/authSchemas';

const router = express.Router();

router.post('/signin', validateRequest(signInSchema), signIn);
router.post('/login', validateRequest(loginSchema), login);
router.get('/me', auth, getCurrentUser);

export default router;