mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-13 20:56:00 +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;
|
status?: number;
|
||||||
plan?: PlanType;
|
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) {
|
if (!authHeader) {
|
||||||
return { success: false, error: "Unauthorized", status: 401 };
|
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);
|
setTimeout(loop, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user