CORRECCION 3
This commit is contained in:
@@ -35,6 +35,7 @@ controlador.auth_redirect = (req, res) => {
|
|||||||
|
|
||||||
controlador.auth = (req, res) => {
|
controlador.auth = (req, res) => {
|
||||||
console.log(req.body);
|
console.log(req.body);
|
||||||
|
if (req.body.password !== "") {
|
||||||
var pwd = stringTo_md5(req.body.password);
|
var pwd = stringTo_md5(req.body.password);
|
||||||
req.getConnection((error, conn, next) => {
|
req.getConnection((error, conn, next) => {
|
||||||
conn.query(`SELECT * FROM usuarios WHERE n_sesion = ? and clave=?`, [req.body.usuario, pwd], (err, rows) => {
|
conn.query(`SELECT * FROM usuarios WHERE n_sesion = ? and clave=?`, [req.body.usuario, pwd], (err, rows) => {
|
||||||
@@ -51,12 +52,16 @@ controlador.auth = (req, res) => {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res.render('login');
|
res.render('login');
|
||||||
//next();
|
next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//conn.end();
|
//conn.end();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.render('login');
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
//res.render('');
|
//res.render('');
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user