This commit is contained in:
parent
cab8a9c8b0
commit
3bf25e5759
|
@ -210,5 +210,5 @@
|
||||||
"CountryFK cannot be empty": "Country cannot be empty",
|
"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 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",
|
"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",
|
"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",
|
"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",
|
"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) => {
|
Self.setUnverifiedPassword = async(id, pass, options) => {
|
||||||
const user = await models.VnUser.findById(id, null, 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 models.VnUser.setPassword(id, pass, options);
|
||||||
await user.updateAttribute('emailVerified', true, options);
|
await user.updateAttribute('emailVerified', true, options);
|
||||||
|
|
|
@ -42,7 +42,7 @@ describe('worker setPassword()', () => {
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} 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();
|
await tx.rollback();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue