add logs
This commit is contained in:
parent
c2387b1017
commit
3080b94640
|
@ -2,6 +2,7 @@ package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
"gitea.urkob.com/urko/prosody-password/internal/services/fail2ban"
|
"gitea.urkob.com/urko/prosody-password/internal/services/fail2ban"
|
||||||
"gitea.urkob.com/urko/prosody-password/internal/services/prosody"
|
"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 {
|
if err := c.BodyParser(&req); err != nil {
|
||||||
return RenderError(c, fmt.Errorf("id is empty"), defaultErrMessage)
|
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 {
|
if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil {
|
||||||
for _, ip := range c.IPs() {
|
for _, ip := range c.IPs() {
|
||||||
handler.fail2banSrv.FailedAttempt(ip)
|
handler.fail2banSrv.FailedAttempt(ip)
|
||||||
|
|
Loading…
Reference in New Issue