Nick: fixes
This commit is contained in:
parent
ace46f340b
commit
33f10a7f91
@ -104,12 +104,13 @@ export async function supaAuthenticateUser(
|
|||||||
case RateLimiterMode.Scrape:
|
case RateLimiterMode.Scrape:
|
||||||
rateLimiter = getRateLimiter(RateLimiterMode.Scrape, token, subscriptionData.plan);
|
rateLimiter = getRateLimiter(RateLimiterMode.Scrape, token, subscriptionData.plan);
|
||||||
break;
|
break;
|
||||||
|
case RateLimiterMode.Search:
|
||||||
|
rateLimiter = getRateLimiter(RateLimiterMode.Search, token, subscriptionData.plan);
|
||||||
|
break;
|
||||||
case RateLimiterMode.CrawlStatus:
|
case RateLimiterMode.CrawlStatus:
|
||||||
rateLimiter = getRateLimiter(RateLimiterMode.CrawlStatus, token);
|
rateLimiter = getRateLimiter(RateLimiterMode.CrawlStatus, token);
|
||||||
break;
|
break;
|
||||||
case RateLimiterMode.Search:
|
|
||||||
rateLimiter = getRateLimiter(RateLimiterMode.Search, token);
|
|
||||||
break;
|
|
||||||
case RateLimiterMode.Preview:
|
case RateLimiterMode.Preview:
|
||||||
rateLimiter = getRateLimiter(RateLimiterMode.Preview, token);
|
rateLimiter = getRateLimiter(RateLimiterMode.Preview, token);
|
||||||
break;
|
break;
|
||||||
|
@ -62,7 +62,7 @@ export function getRateLimiter(mode: RateLimiterMode, token: string, plan?: stri
|
|||||||
if (!rateLimitConfig) return serverRateLimiter;
|
if (!rateLimitConfig) return serverRateLimiter;
|
||||||
|
|
||||||
const planKey = plan ? plan.replace("-", "") : "starter";
|
const planKey = plan ? plan.replace("-", "") : "starter";
|
||||||
const points = rateLimitConfig[planKey] || rateLimitConfig.free;
|
const points = rateLimitConfig[planKey] || rateLimitConfig.preview;
|
||||||
|
|
||||||
return createRateLimiter(`${mode}-${planKey}`, points);
|
return createRateLimiter(`${mode}-${planKey}`, points);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user