From 0e0faa28b3d2b6ce4db5229d526a278d3dbf7a6f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 14 May 2024 14:47:36 -0700 Subject: [PATCH] Update auth.ts --- apps/api/src/controllers/auth.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts index fb3a813..3f343cb 100644 --- a/apps/api/src/controllers/auth.ts +++ b/apps/api/src/controllers/auth.ts @@ -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;