From 8ffe29de78a2e05a39bfb92c14d8a93872ea12eb Mon Sep 17 00:00:00 2001 From: caisi35 Date: Fri, 24 Jan 2025 17:30:27 +0800 Subject: [PATCH] fix(user):"Attempts" create and update to 2 --- internal/user/login.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/user/login.go b/internal/user/login.go index 26b0bb93..518caa98 100644 --- a/internal/user/login.go +++ b/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)) }