diff --git a/internal/services/prosody/account.go b/internal/services/prosody/account.go index 05d962c..e02f857 100644 --- a/internal/services/prosody/account.go +++ b/internal/services/prosody/account.go @@ -32,6 +32,8 @@ func (p *Prosody) loadAccount(username string) (*account, error) { username = strings.Replace(username, p.plainDomain, "", -1) } + log.Println("username", username) + data, err := os.ReadFile(p.accountsPath + username + ".dat") if err != nil { return nil, err diff --git a/internal/services/prosody/change_password.go b/internal/services/prosody/change_password.go index 7b187cb..6d989b4 100644 --- a/internal/services/prosody/change_password.go +++ b/internal/services/prosody/change_password.go @@ -33,7 +33,7 @@ func (p *Prosody) ChangePassword(user string, currentPwd string, newPwd string) return errors.New("password is incorrect") } - cmd := exec.Command("/usr/bin/prosodyctl", "passwd", user) + cmd := exec.Command("/usr/bin/prosodyctl", "passwd", user+"@"+p.plainDomain) // Create a pipe to write to the process's standard input. stdin, err := cmd.StdinPipe() if err != nil {