Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update auth.ts

Nicolas0e0faa28b3d2
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index fb3a813ba..3f343cbb4 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;