Skip to content

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

Update auth.ts

Nicolas8e324534246e
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index 49b2146ad..2aa2297a7 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -51,9 +51,19 @@ export async function supaAuthenticateUser(
if (
token === "this_is_just_a_preview_token" &&
- (mode === RateLimiterMode.Scrape || mode === RateLimiterMode.Preview)
+ (mode === RateLimiterMode.Scrape || mode === RateLimiterMode.Preview || mode === RateLimiterMode.Search)
) {
return { success: true, team_id: "preview" };
+ // check the origin of the request and make sure its from firecrawl.dev
+ // const origin = req.headers.origin;
+ // if (origin && origin.includes("firecrawl.dev")){
+ // return { success: true, team_id: "preview" };
+ // }
+ // if(process.env.ENV !== "production") {
+ // return { success: true, team_id: "preview" };
+ // }
+
+ // return { success: false, error: "Unauthorized: Invalid token", status: 401 };
}
const normalizedApi = parseApi(token);