👔 Make subscribed user no longer need captcha in check in

This commit is contained in:
2025-08-07 02:37:09 +08:00
parent e85af628bf
commit e09922c8df

View File

@@ -14,7 +14,8 @@ public class AccountEventService(
Wallet.PaymentService payment,
ICacheService cache,
IStringLocalizer<Localization.AccountEventResource> localizer,
PusherService.PusherServiceClient pusher
PusherService.PusherServiceClient pusher,
SubscriptionService subscriptions
)
{
private static readonly Random Random = new();
@@ -172,6 +173,9 @@ public class AccountEventService(
public async Task<bool> CheckInDailyDoAskCaptcha(Account user)
{
var perkSubscription = await subscriptions.GetPerkSubscriptionAsync(user.Id);
if (perkSubscription is not null) return false;
var cacheKey = $"{CaptchaCacheKey}{user.Id}";
var needsCaptcha = await cache.GetAsync<bool?>(cacheKey);
if (needsCaptcha is not null)