mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-12 07:29:04 +08:00
Nick:
This commit is contained in:
parent
4d8f4109b5
commit
d8d159b268
@ -206,7 +206,7 @@ export async function supaAuthenticateUser(
|
||||
} else {
|
||||
rateLimiter = getRateLimiter(RateLimiterMode.Preview, token);
|
||||
}
|
||||
teamId = "preview";
|
||||
teamId = `preview_${iptoken}`;
|
||||
plan = "free";
|
||||
} else {
|
||||
normalizedApi = parseApi(token);
|
||||
@ -332,7 +332,7 @@ export async function supaAuthenticateUser(
|
||||
mode === RateLimiterMode.Extract ||
|
||||
mode === RateLimiterMode.Search)
|
||||
) {
|
||||
return { success: true, team_id: "preview", chunk: null, plan: "free" };
|
||||
return { success: true, team_id: `preview_${iptoken}`, chunk: null, plan: "free" };
|
||||
// check the origin of the request and make sure its from firecrawl.dev
|
||||
// const origin = req.headers.origin;
|
||||
// if (origin && origin.includes("firecrawl.dev")){
|
||||
|
@ -22,7 +22,10 @@ export async function crawlPreviewController(req: Request, res: Response) {
|
||||
try {
|
||||
const auth = await authenticateUser(req, res, RateLimiterMode.Preview);
|
||||
|
||||
const team_id = "preview";
|
||||
const incomingIP = (req.headers["x-forwarded-for"] ||
|
||||
req.socket.remoteAddress) as string;
|
||||
const iptoken = incomingIP + "this_is_just_a_preview_token";
|
||||
const team_id = `preview_${iptoken}`;
|
||||
|
||||
if (!auth.success) {
|
||||
return res.status(auth.status).json({ error: auth.error });
|
||||
|
Loading…
x
Reference in New Issue
Block a user