From 3c9d40544c31b0af36e01cc518cdfd16f7683ac7 Mon Sep 17 00:00:00 2001 From: Urko Date: Fri, 4 Aug 2023 23:08:17 +0200 Subject: [PATCH] add some more logs --- internal/services/prosody/account.go | 2 ++ internal/services/prosody/change_password.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 {