login datos solo necesarios

This commit is contained in:
Lemuel Marquez
2021-06-14 00:30:30 -05:00
parent 2f9ba8bbd1
commit e3a7aa5d3d
+3
View File
@@ -23,6 +23,9 @@ const login = async (body) => {
if (!res.activo) throw new Error('Este usuario fue desactivado.');
if (encriptar.comparar(password, res.password)) {
delete res.dataValues.password;
delete res.dataValues.idCarrera;
delete res.dataValues.idTipoUsuario;
delete res.dataValues.telefono;
return {
Usuario: res,
token: crearTokenUsuario({