feat(phase5): integracion auth hibrida, email dinamico y moodle 4.1 backend con tolerancia a fallos

This commit is contained in:
2026-09-23 13:34:59 -03:00
parent 7ad4e3f099
commit 1aae432bba
22 changed files with 2993 additions and 49 deletions
+27
View File
@@ -1233,4 +1233,31 @@ const handleAuditLogs = async (req, res) => {
router.get(['/audit_logs', '/audit-logs', '/audit'], handleAuditLogs);
// ─── 11. CONFIGURACIÓN GLOBAL & MOODLE SYNC ────────────────────────────────────
const handleGlobalSettings = async (req, res) => {
let settings = {
smtp: { host: 'smtp.gmail.com', port: 587, security: 'tls' },
auth_providers: { local: true, google: false, moodle: false },
google_oauth: { allowed_domains: 'unicaba.edu.ar', callback_url: '/auth/google/callback' },
moodle: { server_url: 'http://10.0.0.207/moodle', auto_sync_enabled: true, sync_interval_minutes: 15 }
};
try {
const resp = await req.apiClient.get('/admin/settings/all');
if (resp.data && resp.data.data) {
settings = resp.data.data;
}
} catch (e) {
console.warn('Global settings fetch notice:', e.message);
}
res.render('admin/settings/global_config', {
title: 'Configuración Global del Sistema - Admin Edu-Space',
settings
});
};
router.get(['/settings', '/global-config', '/config'], handleGlobalSettings);
module.exports = router;