From 8278b74ae8d0e9f0cd65c10417458db1cd44a403 Mon Sep 17 00:00:00 2001 From: Urko Date: Wed, 9 Aug 2023 20:04:01 +0200 Subject: [PATCH] fix: get password as formvalue --- internal/api/handler/prosody_hdl.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/api/handler/prosody_hdl.go b/internal/api/handler/prosody_hdl.go index f62dc0b..d4f0f73 100644 --- a/internal/api/handler/prosody_hdl.go +++ b/internal/api/handler/prosody_hdl.go @@ -31,6 +31,8 @@ func (handler ProsodyHandler) Post(c *fiber.Ctx) error { if err := c.BodyParser(&req); err != nil { return RenderError(c, fmt.Errorf(" c.BodyParser(&req): %w", err), defaultErrMessage) } + req.CurrentPassword = c.FormValue("current_password") + req.NewPassword = c.FormValue("new_password") if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil { // for _, ip := range c.IPs() { // handler.fail2banSrv.FailedAttempt(ip)