From 0183d7027f30c4552e59f92fb872f7fbb70763ca Mon Sep 17 00:00:00 2001 From: Oleksandr Andriienko Date: Thu, 25 Jul 2019 14:37:17 +0300 Subject: [PATCH] Fix auth for task plugin task exited feature. (#371) Signed-off-by: Oleksandr Andriienko --- plugins/task-plugin/src/machine/machine-exec-client.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/task-plugin/src/machine/machine-exec-client.ts b/plugins/task-plugin/src/machine/machine-exec-client.ts index ec67dd988..6095f0083 100644 --- a/plugins/task-plugin/src/machine/machine-exec-client.ts +++ b/plugins/task-plugin/src/machine/machine-exec-client.ts @@ -68,7 +68,13 @@ export class MachineExecClient { throw new Error('URL for machine-exec server is not found in the current workspace.'); } - const execServerUrl = applySegmentsToUri(machineExecServerEndpoint, CONNECT_TERMINAL_SEGMENT); + let execServerUrl = applySegmentsToUri(machineExecServerEndpoint, CONNECT_TERMINAL_SEGMENT); + + const machineToken = process.env['CHE_MACHINE_TOKEN']; + if (machineToken) { + execServerUrl = `${execServerUrl}?token=${machineToken}`; + } + this.connection = await createConnection(execServerUrl); this.machineExecWatcher.init(this.connection);