mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
fix(api/websocket): fix auth and termination
This commit is contained in:
parent
1174bc3c82
commit
d4001e4528
|
@ -104,7 +104,8 @@ export async function supaAuthenticateUser(
|
|||
status?: number;
|
||||
plan?: PlanType;
|
||||
}> {
|
||||
const authHeader = req.headers.authorization;
|
||||
console.log(req.headers);
|
||||
const authHeader = req.headers.authorization ?? (req.headers["sec-websocket-protocol"] ? `Bearer ${req.headers["sec-websocket-protocol"]}` : null);
|
||||
if (!authHeader) {
|
||||
return { success: false, error: "Unauthorized", status: 401 };
|
||||
}
|
||||
|
|
|
@ -85,6 +85,8 @@ async function crawlStatusWS(ws: WebSocket, req: RequestWithAuth<CrawlStatusPara
|
|||
}
|
||||
}
|
||||
|
||||
doneJobIDs.push(...newlyDoneJobIDs);
|
||||
|
||||
setTimeout(loop, 1000);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user