👔 Make subscribed user no longer need captcha in check in
This commit is contained in:
@@ -14,7 +14,8 @@ public class AccountEventService(
|
|||||||
Wallet.PaymentService payment,
|
Wallet.PaymentService payment,
|
||||||
ICacheService cache,
|
ICacheService cache,
|
||||||
IStringLocalizer<Localization.AccountEventResource> localizer,
|
IStringLocalizer<Localization.AccountEventResource> localizer,
|
||||||
PusherService.PusherServiceClient pusher
|
PusherService.PusherServiceClient pusher,
|
||||||
|
SubscriptionService subscriptions
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
private static readonly Random Random = new();
|
private static readonly Random Random = new();
|
||||||
@@ -172,6 +173,9 @@ public class AccountEventService(
|
|||||||
|
|
||||||
public async Task<bool> CheckInDailyDoAskCaptcha(Account user)
|
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 cacheKey = $"{CaptchaCacheKey}{user.Id}";
|
||||||
var needsCaptcha = await cache.GetAsync<bool?>(cacheKey);
|
var needsCaptcha = await cache.GetAsync<bool?>(cacheKey);
|
||||||
if (needsCaptcha is not null)
|
if (needsCaptcha is not null)
|
||||||
|
Reference in New Issue
Block a user