mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-13 03:09:11 +08:00
Only check Supabase if configured to
This commit is contained in:
parent
e779dbbe26
commit
a2ae5f81d9
@ -8,6 +8,8 @@ import { billTeam } from "../../src/services/billing/credit_billing";
|
|||||||
|
|
||||||
export async function crawlCancelController(req: Request, res: Response) {
|
export async function crawlCancelController(req: Request, res: Response) {
|
||||||
try {
|
try {
|
||||||
|
const useDbAuthentication = process.env.USE_DB_AUTHENTICATION === 'true';
|
||||||
|
|
||||||
const { success, team_id, error, status } = await authenticateUser(
|
const { success, team_id, error, status } = await authenticateUser(
|
||||||
req,
|
req,
|
||||||
res,
|
res,
|
||||||
@ -22,6 +24,7 @@ export async function crawlCancelController(req: Request, res: Response) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if the job belongs to the team
|
// check if the job belongs to the team
|
||||||
|
if (useDbAuthentication) {
|
||||||
const { data, error: supaError } = await supabase_service
|
const { data, error: supaError } = await supabase_service
|
||||||
.from("bulljobs_teams")
|
.from("bulljobs_teams")
|
||||||
.select("*")
|
.select("*")
|
||||||
@ -34,6 +37,8 @@ export async function crawlCancelController(req: Request, res: Response) {
|
|||||||
if (data.length === 0) {
|
if (data.length === 0) {
|
||||||
return res.status(403).json({ error: "Unauthorized" });
|
return res.status(403).json({ error: "Unauthorized" });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const jobState = await job.getState();
|
const jobState = await job.getState();
|
||||||
const { partialDocs } = await job.progress();
|
const { partialDocs } = await job.progress();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user