password se agrego 2 caracteres más a la string
This commit is contained in:
@@ -19,9 +19,9 @@ export class BcryptService {
|
||||
}
|
||||
|
||||
generarPassword = () => {
|
||||
const length = 8;
|
||||
const length = 10;
|
||||
const charset =
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-@#$%&=?¿*()/_-';
|
||||
let password = '';
|
||||
|
||||
for (let i = 0; i < length; i++)
|
||||
|
||||
@@ -98,10 +98,6 @@ export class UsuarioService {
|
||||
/* Falta conexión a soap */
|
||||
if (existeUsuario.password)
|
||||
throw new ConflictException('Ya fue regisrado este número de cuenta.');
|
||||
// if (!existeUsuario.activo)
|
||||
// throw new ConflictException(
|
||||
// 'No se puede registar con este número de cuenta por que se encuentra desactivado.',
|
||||
// );
|
||||
return this.institucionUsuarioService.findByUsuarioInstitucionCarrera(
|
||||
existeUsuario,
|
||||
institucionCarrera,
|
||||
@@ -116,28 +112,28 @@ export class UsuarioService {
|
||||
id_institucion,
|
||||
1,
|
||||
);
|
||||
const query = this.repository
|
||||
|
||||
return this.repository
|
||||
.createQueryBuilder('u')
|
||||
.innerJoinAndSelect('u.instituciones', 'is')
|
||||
.innerJoinAndSelect('u.tipoUsuario', 'tu')
|
||||
.innerJoinAndSelect('is.institucionCarrera', 'ic')
|
||||
.innerJoinAndSelect('ic.carrera', 'c')
|
||||
.innerJoinAndSelect('ic.institucion', 'i')
|
||||
.innerJoinAndSelect('c.nivel', 'n')
|
||||
.where('usuario = :usuario && rfc = :rfc', { usuario, rfc });
|
||||
|
||||
return query.getOne().then((usuario) => {
|
||||
if (!usuario) throw new NotFoundException('No existe este usuario.');
|
||||
if (usuario.password)
|
||||
throw new ConflictException(
|
||||
'Ya fue regisrado este número de trabajador.',
|
||||
.where('usuario = :usuario && rfc = :rfc', { usuario, rfc })
|
||||
.getOne()
|
||||
.then((usuario) => {
|
||||
if (!usuario) throw new NotFoundException('No existe este usuario.');
|
||||
if (usuario.password)
|
||||
throw new ConflictException(
|
||||
'Ya fue regisrado este número de trabajador.',
|
||||
);
|
||||
return this.institucionUsuarioService.findByUsuarioInstitucionCarrera(
|
||||
usuario,
|
||||
institucionCarrera,
|
||||
'trabajador',
|
||||
);
|
||||
return this.institucionUsuarioService.findByUsuarioInstitucionCarrera(
|
||||
usuario,
|
||||
institucionCarrera,
|
||||
'trabajador',
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async findAll(filtros: {
|
||||
|
||||
Reference in New Issue
Block a user