0

Update auth.ts

This commit is contained in:
Nicolas 2024-05-14 14:47:36 -07:00
parent 4761ea510b
commit 0e0faa28b3

View File

@ -45,8 +45,10 @@ export async function supaAuthenticateUser(
} else {
normalizedApi = parseApi(token);
console.log('normalizedApi:', normalizedApi);
const { data, error } = await supabase_service.rpc(
'get_key_and_price_id', { api_key: normalizedApi });
'get_key_and_price_id_2', { api_key: normalizedApi });
if (error) {
console.error('Error fetching key and price_id:', error);
@ -73,6 +75,12 @@ export async function supaAuthenticateUser(
case RateLimiterMode.Scrape:
rateLimiter = scrapeRateLimit(subscriptionData.plan);
break;
case RateLimiterMode.CrawlStatus:
rateLimiter = await getRateLimiter(RateLimiterMode.CrawlStatus, token);
break;
default:
rateLimiter = await getRateLimiter(RateLimiterMode.Crawl, token);
break;
// case RateLimiterMode.Search:
// rateLimiter = await searchRateLimiter(RateLimiterMode.Search, token);
// break;