Only include successful attempts in statistics (#1420)

This commit is contained in:
Leendert de Borst
2025-12-01 23:08:38 +01:00
parent 40686f97e0
commit c0cbc0be7b

View File

@@ -624,6 +624,7 @@ public class StatisticsService
.Where(al => al.Timestamp >= cutoffDate &&
al.IpAddress != null &&
al.IpAddress != "xxx.xxx.xxx.xxx" &&
al.IsSuccess &&
al.EventType == AuthEventType.AccountDeletion)
.GroupBy(al => al.IpAddress)
.Select(g => new
@@ -656,6 +657,7 @@ public class StatisticsService
var topUsernames = await context.AuthLogs
.Where(al => al.Timestamp >= cutoffDate &&
al.Username != null &&
al.IsSuccess &&
al.EventType == AuthEventType.AccountDeletion)
.GroupBy(al => al.Username)
.Select(g => new