This commit is contained in:
Urko 2023-07-07 23:46:25 +02:00
parent c2387b1017
commit 3080b94640
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package handler
import (
"fmt"
"log"
"gitea.urkob.com/urko/prosody-password/internal/services/fail2ban"
"gitea.urkob.com/urko/prosody-password/internal/services/prosody"
@ -31,7 +32,7 @@ func (handler ProsodyHandler) Post(c *fiber.Ctx) error {
if err := c.BodyParser(&req); err != nil {
return RenderError(c, fmt.Errorf("id is empty"), defaultErrMessage)
}
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 {
for _, ip := range c.IPs() {
handler.fail2banSrv.FailedAttempt(ip)