From 321ae008d45659f50235eaaec6fc079f519b4bff Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 10 Oct 2024 03:26:12 +0530 Subject: [PATCH] feat: use userId for getDecryptedProxyConfig --- server/src/workflow-management/scheduler/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/workflow-management/scheduler/index.ts b/server/src/workflow-management/scheduler/index.ts index cc22f712..48948c65 100644 --- a/server/src/workflow-management/scheduler/index.ts +++ b/server/src/workflow-management/scheduler/index.ts @@ -12,7 +12,7 @@ import Robot from "../../models/Robot"; import Run from "../../models/Run"; import { getDecryptedProxyConfig } from "../../routes/proxy"; -async function runWorkflow(id: string) { +async function runWorkflow(id: string, userId: string) { if (!id) { id = uuid(); } @@ -32,7 +32,7 @@ async function runWorkflow(id: string) { } // req.user.id will not be available here :) - const proxyConfig = await getDecryptedProxyConfig(req.user.id); + const proxyConfig = await getDecryptedProxyConfig(userId); let proxyOptions: any = {}; if (proxyConfig.proxy_url) { @@ -175,8 +175,8 @@ export async function handleRunRecording(id: string, userId: string) { const result = await runWorkflow(id); const { browserId, runId: newRunId } = result; - if (!browserId || !newRunId) { - throw new Error('browserId or runId is undefined'); + if (!browserId || !newRunId || !userId) { + throw new Error('browserId or runId or userId is undefined'); } const socket = io(`http://localhost:8080/${browserId}`, {