feat(reception,udeci): v3.8.48 - forced scanner focus, spanish keyboard gun normalization, reception default dashboard, and udeci commission listings

This commit is contained in:
2026-10-28 13:01:44 -03:00
parent e84a236d54
commit 3dbd22cc3c
18 changed files with 444 additions and 70 deletions
+3 -3
View File
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
});
// Versiones institucionales del sistema
const APP_VERSION = '3.8.47';
const FRONTEND_VERSION = '3.8.47';
const BACKEND_VERSION = '3.8.47';
const APP_VERSION = '3.8.48';
const FRONTEND_VERSION = '3.8.48';
const BACKEND_VERSION = '3.8.48';
env.addGlobal('app_version', APP_VERSION);
env.addGlobal('frontend_version', FRONTEND_VERSION);
+9 -3
View File
@@ -64,7 +64,9 @@ router.post('/login', async (req, res) => {
sameSite: 'lax',
maxAge: 24 * 60 * 60 * 1000 // 1 día
});
return res.redirect('/dashboard');
const userRole = (response.data.user?.role || '').toLowerCase();
const target = (userRole === 'recepcion' || userRole === 'reception') ? '/reception/scanner' : '/dashboard';
return res.redirect(target);
}
return res.redirect('/auth/login?error=' + encodeURIComponent('Autenticación fallida'));
@@ -89,7 +91,9 @@ router.post('/moodle', async (req, res) => {
sameSite: 'lax',
maxAge: 24 * 60 * 60 * 1000
});
return res.redirect('/dashboard');
const userRole = (response.data.user?.role || '').toLowerCase();
const target = (userRole === 'recepcion' || userRole === 'reception') ? '/reception/scanner' : '/dashboard';
return res.redirect(target);
}
res.redirect('/auth/login?error=moodle_auth_failed');
} catch (error) {
@@ -112,7 +116,9 @@ router.post('/google', async (req, res) => {
sameSite: 'lax',
maxAge: 24 * 60 * 60 * 1000
});
return res.json({ success: true, redirect: '/dashboard' });
const userRole = (response.data.user?.role || '').toLowerCase();
const target = (userRole === 'recepcion' || userRole === 'reception') ? '/reception/scanner' : '/dashboard';
return res.json({ success: true, redirect: target });
}
return res.status(401).json({ success: false, message: 'Fallo al autenticar con Google.' });
} catch (error) {
+1 -1
View File
@@ -36,7 +36,7 @@ router.get('/token', async (req, res) => {
} catch (err) {
console.warn('API error fetching QR token:', err.message);
// Fallback token if reception endpoint fails or is offline
const fallbackToken = `UNICABA:USR:${req.user?.id || 0}:DNI:${req.user?.document_number || req.user?.email || 'N/A'}`;
const fallbackToken = `UNICABA:USR:${req.user?.id || 0}:DNI:${req.user?.document_number || req.user?.id || req.user?.email || 'N/A'}`;
return res.json({
status: 'fallback',
qr_token: fallbackToken,
+3
View File
@@ -6,6 +6,9 @@ router.use(requireAuth);
router.get('/', async (req, res) => {
const actual_role = (req.user?.role || 'admin').toLowerCase();
if (actual_role === 'recepcion' || actual_role === 'reception') {
return res.redirect('/reception/scanner');
}
const roleParam = (req.query.role || req.query.view_as || '').toLowerCase().trim();
const role = (['admin', 'bedelia', 'docente', 'alumno'].includes(roleParam) ? roleParam : actual_role) || 'admin';
+4 -1
View File
@@ -2,7 +2,10 @@ const express = require('express');
const router = express.Router();
router.get('/', (req, res) => {
// Redirigimos por defecto a dashboard o login
const userRole = (req.user?.role || '').toLowerCase();
if (userRole === 'recepcion' || userRole === 'reception') {
return res.redirect('/reception/scanner');
}
res.redirect('/dashboard');
});