fix: tune up

This commit is contained in:
2023-08-09 19:30:07 +02:00
parent ee99e81991
commit 33ed5d6af5
3 changed files with 1 additions and 15 deletions

View File

@@ -2,7 +2,6 @@ package handler
import (
"fmt"
"log"
"gitea.urkob.com/urko/prosody-password/internal/services/fail2ban"
"gitea.urkob.com/urko/prosody-password/internal/services/prosody"
@@ -28,16 +27,10 @@ type changePasswordReq struct {
}
func (handler ProsodyHandler) Post(c *fiber.Ctx) error {
log.Println("body", string(c.Body()))
req := changePasswordReq{}
if err := c.BodyParser(&req); err != nil {
return RenderError(c, fmt.Errorf(" c.BodyParser(&req): %w", err), defaultErrMessage)
}
// req := changePasswordReq{
// CurrentPassword: c.FormValue("current_password", ""),
// NewPassword: c.FormValue("new_password", ""),
// User: c.FormValue("user", ""),
// }
if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil {
// for _, ip := range c.IPs() {
// handler.fail2banSrv.FailedAttempt(ip)