implement the new password hashing approach (#156)

This commit is contained in:
Michael Quigley
2023-01-23 12:50:24 -05:00
parent 45d83d1521
commit b32ee6350e
6 changed files with 68 additions and 15 deletions

View File

@ -37,7 +37,13 @@ func (handler *resetPasswordHandler) Handle(params account.ResetPasswordParams)
logrus.Error(err)
return account.NewResetPasswordNotFound()
}
a.Password = hashPassword(params.Body.Password)
hpwd, err := hashPassword(params.Body.Password)
if err != nil {
logrus.Error(err)
return account.NewResetPasswordRequestInternalServerError()
}
a.Salt = hpwd.Salt
a.Password = hpwd.Password
if _, err := str.UpdateAccount(a, tx); err != nil {
logrus.Error(err)