feature/Reynolds-and-Reynolds-DMS-API-Integration - Use current Token
This commit is contained in:
@@ -172,8 +172,11 @@ async function RRSelectedCustomer({ socket, redisHelpers, selectedCustomerId, jo
|
|||||||
// --- GraphQL job fetch
|
// --- GraphQL job fetch
|
||||||
async function QueryJobData({ socket, jobid }) {
|
async function QueryJobData({ socket, jobid }) {
|
||||||
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
|
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
|
const result = await client
|
||||||
.setHeaders({ Authorization: `Bearer ${socket.handshake?.auth?.token}` })
|
.setHeaders({ Authorization: `Bearer ${currentToken}` })
|
||||||
.request(queries.QUERY_JOBS_FOR_CDK_EXPORT, { id: jobid });
|
.request(queries.QUERY_JOBS_FOR_CDK_EXPORT, { id: jobid });
|
||||||
return result.jobs_by_pk;
|
return result.jobs_by_pk;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user