#6744 fix worker setPassword #2027
|
@ -210,5 +210,5 @@
|
|||
"CountryFK cannot be empty": "Country cannot be empty",
|
||||
"You are not allowed to modify the alias": "You are not allowed to modify the alias",
|
||||
"You already have the mailAlias": "You already have the mailAlias",
|
||||
"The email has been already verified": "The email has been already verified"
|
||||
"This password can only be changed by the user themselves": "This password can only be changed by the user themselves"
|
||||
}
|
||||
|
|
|
@ -345,5 +345,5 @@
|
|||
"Cmr file does not exist": "El archivo del cmr no existe",
|
||||
"You are not allowed to modify the alias": "No estás autorizado a modificar el alias",
|
||||
"No tickets to invoice": "No hay tickets para facturar",
|
||||
"The email has been already verified": "El correo ya ha sido verificado"
|
||||
"This password can only be changed by the user themselves": "Esta contraseña solo puede ser modificada por el propio usuario"
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ module.exports = Self => {
|
|||
|
||||
Self.setUnverifiedPassword = async(id, pass, options) => {
|
||||
const user = await models.VnUser.findById(id, null, options);
|
||||
if (user.emailVerified) throw new ForbiddenError('The email has been already verified');
|
||||
if (user.emailVerified) throw new ForbiddenError('This password can only be changed by the user themselves');
|
||||
|
||||
await models.VnUser.setPassword(id, pass, options);
|
||||
await user.updateAttribute('emailVerified', true, options);
|
||||
jorgep marked this conversation as resolved
|
||||
|
|
|
@ -42,7 +42,7 @@ describe('worker setPassword()', () => {
|
|||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual(`The email has been already verified`);
|
||||
expect(e.message).toEqual(`This password can only be changed by the user themselves`);
|
||||
await tx.rollback();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
porque activas el correo aqui? si el usuario no consigue entrar por cualquier razón no debería verificarse el mail
me lo pidio expresamente @juan . A que te refieres con que no consigue entrar?
Considero que és un mal enfoque.
El hecho de cambiar la contraseña no es lo mismo que hacer un login satisfactorio.
Bajo mi punto de vista poner el email verificado a true sólo se debería hacer cuando el usuario ha conseguido hacer un login satisfactorio
Paso la tarea a feedback pues
después de hablar con Juan quitar await user.updateAttribute('emailVerified', true, options);
poner el email verificado a true sólo se debería hacer cuando el usuario ha conseguido hacer un login satisfactorio