diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts index 33e9695..2154504 100644 --- a/apps/api/src/controllers/auth.ts +++ b/apps/api/src/controllers/auth.ts @@ -104,12 +104,13 @@ export async function supaAuthenticateUser( case RateLimiterMode.Scrape: rateLimiter = getRateLimiter(RateLimiterMode.Scrape, token, subscriptionData.plan); break; + case RateLimiterMode.Search: + rateLimiter = getRateLimiter(RateLimiterMode.Search, token, subscriptionData.plan); + break; case RateLimiterMode.CrawlStatus: rateLimiter = getRateLimiter(RateLimiterMode.CrawlStatus, token); break; - case RateLimiterMode.Search: - rateLimiter = getRateLimiter(RateLimiterMode.Search, token); - break; + case RateLimiterMode.Preview: rateLimiter = getRateLimiter(RateLimiterMode.Preview, token); break; diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts index 6e09310..a0a6f16 100644 --- a/apps/api/src/services/rate-limiter.ts +++ b/apps/api/src/services/rate-limiter.ts @@ -62,7 +62,7 @@ export function getRateLimiter(mode: RateLimiterMode, token: string, plan?: stri if (!rateLimitConfig) return serverRateLimiter; const planKey = plan ? plan.replace("-", "") : "starter"; - const points = rateLimitConfig[planKey] || rateLimitConfig.free; + const points = rateLimitConfig[planKey] || rateLimitConfig.preview; return createRateLimiter(`${mode}-${planKey}`, points); }