From 1146d35334b88ff8aa83e3defbd4a5ddabcadcf9 Mon Sep 17 00:00:00 2001 From: AlanMoonbase Date: Thu, 12 Dec 2024 16:20:05 -0800 Subject: [PATCH] Refine Recent Ban Search --- src/Controllers/Common/AuthenticationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controllers/Common/AuthenticationController.cs b/src/Controllers/Common/AuthenticationController.cs index c9517fa..11e7902 100644 --- a/src/Controllers/Common/AuthenticationController.cs +++ b/src/Controllers/Common/AuthenticationController.cs @@ -57,7 +57,7 @@ public class AuthenticationController : Controller { } // check for recent bans, if recent ban is not up and is a complete suspension, disallow login - UserBan? userBan = moderationService.GetLatestBanFromUser(user); + UserBan? userBan = moderationService.GetAllBansFromUser(user, true).FirstOrDefault(e => e.BanType == UserBanType.IndefiniteSuspension || e.BanType == UserBanType.TemporarySuspension); if(userBan is not null) { if (userBan.BanType != UserBanType.IndefiniteSuspension && DateTime.Compare(DateTime.UtcNow, userBan.EndsAt!.Value) >= 0) { moderationService.RemoveBanFromUser(user, userBan); userBan.EndsAt = DateTime.UtcNow; } // remove ban if its up and set retreived userban to have an end date of now