From d95c5ce8f9bcefff374f3424c1b90023ac2918aa Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 1 Oct 2025 14:22:18 -0400 Subject: [PATCH] feature/Reynolds-and-Reynolds-DMS-API-Integration - Use current Token --- server/rr/rr-job-export.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/rr/rr-job-export.js b/server/rr/rr-job-export.js index 8a657b25e..79f0a970f 100644 --- a/server/rr/rr-job-export.js +++ b/server/rr/rr-job-export.js @@ -172,8 +172,11 @@ async function RRSelectedCustomer({ socket, redisHelpers, selectedCustomerId, jo // --- GraphQL job fetch async function QueryJobData({ socket, jobid }) { const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {}); + const currentToken = + (socket?.data && socket.data.authToken) || (socket?.handshake?.auth && socket.handshake.auth.token); + const result = await client - .setHeaders({ Authorization: `Bearer ${socket.handshake?.auth?.token}` }) + .setHeaders({ Authorization: `Bearer ${currentToken}` }) .request(queries.QUERY_JOBS_FOR_CDK_EXPORT, { id: jobid }); return result.jobs_by_pk; }