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);