desvergue-de-alexandro
js 30 lines 1011 Bytes
Raw
1 /** Acceso provisional solo para revisar la interfaz (sin backend). */
2 const DEV_LOGIN = {
3 email: 'demo@tecmilenio.mx',
4 password: 'Demo1234',
5 user: {
6 nombre: 'Usuario Demo',
7 email: 'demo@tecmilenio.mx',
8 rol: 'ESTUDIANTE'
9 }
10 };
11
12 document.addEventListener('DOMContentLoaded', () => {
13 Auth.redirectIfAuthenticated();
14
15 document.getElementById('login-form').addEventListener('submit', (e) => {
16 e.preventDefault();
17 Utils.clearAlert('alert-container');
18
19 const email = document.getElementById('email').value.trim();
20 const password = document.getElementById('password').value;
21
22 if (email === DEV_LOGIN.email && password === DEV_LOGIN.password) {
23 Auth.saveSession('token-provisional-dev', DEV_LOGIN.user);
24 window.location.href = 'pages/inicio.html';
25 return;
26 }
27
28 Utils.showAlert('alert-container', 'Correo o contraseña incorrectos. Usa las credenciales provisionales.');
29 });
30 });