fix parse to int
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
|
||||
"github.com/xdg-go/pbkdf2"
|
||||
)
|
||||
@@ -18,7 +19,12 @@ 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)
|
||||
iterationCount, err := strconv.Atoi(acc.IterationCount)
|
||||
if err != nil {
|
||||
return fmt.Errorf("strconv.Atoi %w", err)
|
||||
}
|
||||
|
||||
storedKey, err := hashPassword(currentPwd, acc.Salt, iterationCount)
|
||||
if err != nil {
|
||||
return fmt.Errorf("hashPassword: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user