diff --git a/packages/bruno-core/src/codeGenerator/index.ts b/packages/bruno-core/src/codeGenerator/index.ts index 66b41269d1..658d7cbb31 100644 --- a/packages/bruno-core/src/codeGenerator/index.ts +++ b/packages/bruno-core/src/codeGenerator/index.ts @@ -61,8 +61,11 @@ export async function generateCode( variables: { process: { process: { - // @ts-ignore - env: process.env + // @ts-expect-error `process.env` is a dict with weird typings + env: { + ...process.env, + ...collection.processEnvVariables + } } }, environment: environmentVariableRecord, diff --git a/packages/bruno-electron/src/ipc/collection.js b/packages/bruno-electron/src/ipc/collection.js index d9ba5b1ef5..dd4cf7fae7 100644 --- a/packages/bruno-electron/src/ipc/collection.js +++ b/packages/bruno-electron/src/ipc/collection.js @@ -34,6 +34,7 @@ const { getPreferences } = require('../store/preferences'); const { getRequestFromCurlCommand } = require('../utils/curl'); const Watcher = require('../app/watcher'); const LastOpenedCollection = require('../store/last-opened-collections'); +const { handleAuthorizationCodeInElectron } = require('../utils/handleAuthorizationCodeInElectron'); const environmentSecretsStore = new EnvironmentSecretsStore(); @@ -754,7 +755,16 @@ ipcMain.handle('renderer:delete-cookies-for-domain', async (event, domain) => { }); ipcMain.handle('renderer:generate-code', async (event, item, collection, environment, globalVariables, options) => { - return await generateCode(item, collection, getPreferences(), cookieJar, options, environment, globalVariables); + return await generateCode( + item, + collection, + getPreferences(), + cookieJar, + options, + handleAuthorizationCodeInElectron, + environment, + globalVariables + ); }); ipcMain.handle('renderer:curl-to-request', async (event, curlString) => {