fix unmarshal panic

This commit is contained in:
2023-07-07 23:36:05 +02:00
parent dff505037f
commit 0d4f34f6d5
3 changed files with 6 additions and 6 deletions

View File

@@ -18,13 +18,13 @@ func (p *Prosody) ChangePassword(user string, currentPwd string, newPwd string)
return fmt.Errorf("p.loadAccount %w", err)
}
storedKey, err := hashPassword(currentPwd, acc.salt, acc.iterationCount)
storedKey, err := hashPassword(currentPwd, acc.Salt, acc.IterationCount)
if err != nil {
return fmt.Errorf("hashPassword: %w", err)
}
// Compare the hashes
if storedKey != acc.storedKey {
if storedKey != acc.StoredKey {
return errors.New("password is incorrect")
}