Преглед изворни кода

Log failed authentication attempts with remote address for fail2ban (#2334)

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
tags/v1.3.0-rc1
David Schneiderbauer пре 6 година
родитељ
комит
174255e74e
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2
    0
      routers/user/auth.go

+ 2
- 0
routers/user/auth.go Прегледај датотеку

@@ -154,8 +154,10 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) {
if err != nil {
if models.IsErrUserNotExist(err) {
ctx.RenderWithErr(ctx.Tr("form.username_password_incorrect"), tplSignIn, &form)
log.Info("Failed authentication attempt for %s from %s", form.UserName, ctx.RemoteAddr())
} else if models.IsErrEmailAlreadyUsed(err) {
ctx.RenderWithErr(ctx.Tr("form.email_been_used"), tplSignIn, &form)
log.Info("Failed authentication attempt for %s from %s", form.UserName, ctx.RemoteAddr())
} else {
ctx.Handle(500, "UserSignIn", err)
}

Loading…
Откажи
Сачувај