This commit is contained in:
tsmethurst 2021-10-12 18:08:28 +02:00
commit d6cc79ba97
2 changed files with 3 additions and 3 deletions

View file

@ -25,13 +25,13 @@ type PasswordChangeRequest struct {
// User's previous password.
//
// in: formData
// required: true
// required: true
OldPassword string `form:"old_password" json:"old_password" xml:"old_password" validation:"required"`
// Desired new password.
// If the password does not have high enough entropy, it will be rejected.
// See https://github.com/wagslane/go-password-validator
//
// in: formData
// required: true
// required: true
NewPassword string `form:"new_password" json:"new_password" xml:"new_password" validation:"required"`
}

View file

@ -37,7 +37,7 @@ func (suite *ChangePasswordTestSuite) TestChangePasswordOK() {
errWithCode := suite.user.ChangePassword(context.Background(), user, "password", "verygoodnewpassword")
suite.NoError(errWithCode)
err := bcrypt.CompareHashAndPassword([]byte(user.EncryptedPassword), []byte("verygoodnewpassword"))
suite.NoError(err)