const express = require('express');
const router = express.Router();
const authController = require('../controllers/authController');
const passwordRecoveryController = require('../controllers/passwordRecoveryController');
const { authLimiter } = require('../middleware/rateLimiter');

// Login route with rate limiting
router.post('/login', authLimiter, authController.login);

// Password recovery route with rate limiting
router.post('/recover-password', authLimiter, passwordRecoveryController.requestPassword);

// Logout route
router.post('/logout', authController.logout);

// Check authentication status
router.get('/check', authController.check);

module.exports = router;