From 8e324534246eea0daf25c354032ab1c4facfe6af Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 26 Apr 2024 12:57:49 -0700 Subject: [PATCH] Update auth.ts --- apps/api/src/controllers/auth.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts index 49b2146..2aa2297 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);