From e9bb11d03bdf5680ed3b44ab1eb908f6cd89652a Mon Sep 17 00:00:00 2001 From: John Poth Date: Wed, 4 Sep 2019 18:09:13 +0200 Subject: [PATCH] Fix environment variables in Exec plugin --- lib/auth/exec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/auth/exec.js b/lib/auth/exec.js index 450d8cc..7bc6bcc 100644 --- a/lib/auth/exec.js +++ b/lib/auth/exec.js @@ -34,18 +34,18 @@ class ExecAuth { promise = Promise.resolve(this.auth_provider); } else { promise = new Promise((resolve, reject) => { - const env = {}; + const env = Object.assign({}, process.env); if(this.auth_provider.env) { this.auth_provider.env.forEach(kvp => env[kvp.name] = kvp.value); } - const process = execFile(this.auth_provider.command, this.auth_provider.args , { env }, (error, stdout, stderr) => { + const exec = execFile(this.auth_provider.command, this.auth_provider.args , { env }, (error, stdout, stderr) => { cancel = function (){}; if (error) { reject(error); } resolve(stdout); }); - cancel = function() { process.kill() }; + cancel = function() { exec.kill() }; }); promise = promise.then( response => { const json = JSON.parse(response);