diff --git a/internal/api/handler/prosody_hdl.go b/internal/api/handler/prosody_hdl.go index a39f214..76102c6 100644 --- a/internal/api/handler/prosody_hdl.go +++ b/internal/api/handler/prosody_hdl.go @@ -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" @@ -34,7 +33,6 @@ func (handler ProsodyHandler) Post(c *fiber.Ctx) error { } if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil { - log.Println("c.IPs()", c.IPs()) for _, ip := range c.IPs() { handler.fail2banSrv.FailedAttempt(ip) } diff --git a/internal/api/server.go b/internal/api/server.go index 2059c99..28c4960 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -46,6 +46,8 @@ func (s *RestServer) Start(apiPort, views string) error { prosodyHdl := handler.NewProsodyHandler(s.prosodyService, s.fail2banSrv) s.app.Post("/changePassword", func(c *fiber.Ctx) error { + log.Println("c.IPs()", c.IPs()) + log.Println("c.IP", c.IP()) for _, ip := range c.IPs() { if !s.fail2banSrv.CanChangePassword(ip) { return handler.RenderError(c, fmt.Errorf("id is empty"), "Too many tries, blocked for 1h")