smtp integration and password recovery.

This commit is contained in:
2025-07-31 11:58:48 -06:00
parent 7335c6c3a1
commit 8d6ebc917b
12 changed files with 427 additions and 13 deletions

View File

@@ -1,11 +1,15 @@
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);

View File

@@ -261,4 +261,22 @@ router.get('/login-structure', async (req, res) => {
}
});
// Reload email templates (development only)
router.get('/reload-email-templates', (req, res) => {
try {
const emailTemplates = require('../services/emailTemplates');
emailTemplates.clearCache();
res.json({
success: true,
message: 'Email template cache cleared'
});
} catch (error) {
logger.error('Error clearing email template cache:', error);
res.status(500).json({
success: false,
error: 'Failed to clear email template cache'
});
}
});
module.exports = router;