Merge pull request #831 from caisi35/dev

fix duplicate user and attempts
This commit is contained in:
Jacky 2025-01-31 21:33:41 +08:00 committed by GitHub
commit 80f01e61d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -36,6 +36,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))
}