diff --git a/internal/api/handler/prosody_hdl.go b/internal/api/handler/prosody_hdl.go index dfc0436..84e87d3 100644 --- a/internal/api/handler/prosody_hdl.go +++ b/internal/api/handler/prosody_hdl.go @@ -28,9 +28,10 @@ type changePasswordReq struct { } func (handler ProsodyHandler) Post(c *fiber.Ctx) error { - req := changePasswordReq{} - if err := c.BodyParser(&req); err != nil { - return RenderError(c, fmt.Errorf("id is empty"), defaultErrMessage) + req := changePasswordReq{ + CurrentPassword: c.FormValue("current_password", ""), + NewPassword: c.FormValue("new_password", ""), + User: c.FormValue("user", ""), } log.Println("req.User, req.CurrentPassword, req.NewPassword", req.User, req.CurrentPassword, req.NewPassword) if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil {