Skip to content

Commit

Permalink
update schemas messaes and token size
Browse files Browse the repository at this point in the history
  • Loading branch information
jodaz committed Nov 18, 2023
1 parent 096ec1f commit e472502
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/controllers/ResetPasswordController.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const resetPasswordMobile = async (req, res) => {
if (!reqErrors) {
const user = await User.query().where('email',req.body.email).first()

const token = await makeToken(10)
const token = await makeToken(6)

await PasswordReset.query().insert({user_id : user.id,token : token})
// Send email
Expand Down
6 changes: 3 additions & 3 deletions src/validations/reset-password.schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const validateVerifyToken = {
});

if (!token) {
throw new Error("El vínculo utilizado ha dejado de ser válido.");
throw new Error("invalid");
}
}
}
Expand All @@ -39,12 +39,12 @@ export const validateVerifyToken = {
export const validateNewPassword = {
password: {
notEmpty: {
errorMessage: 'Ingrese su nueva contraseña'
errorMessage: 'required'
}
},
password_confirmed: {
notEmpty: {
errorMessage: 'Repita su contraseña'
errorMessage: 'repeat'
}
},
...validateVerifyToken
Expand Down

0 comments on commit e472502

Please sign in to comment.