Browse Source

fix(user):"Attempts" create and update to 2

caisi35 6 months ago
parent
commit
8ffe29de78
1 changed files with 1 additions and 0 deletions
  1. 1 0
      internal/user/login.go

+ 1 - 0
internal/user/login.go

@@ -42,6 +42,7 @@ func BanIP(ip string) {
 			Attempts:  1,
 			ExpiredAt: time.Now().Unix() + int64(settings.AuthSettings.BanThresholdMinutes*60),
 		})
+		return
 	}
 	_, _ = b.Where(b.IP.Eq(ip)).UpdateSimple(b.Attempts.Add(1))
 }