Skip to content

Commit

Permalink
Merge pull request #3392 from lohxt1/fix/oauth2-global-env-values
Browse files Browse the repository at this point in the history
fix: include global env varaibles for oauth2
  • Loading branch information
lohxt1 authored Oct 30, 2024
2 parents fe2b45f + 6bebbfe commit a580f88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const sendCollectionOauth2Request = (collectionUid, itemUid) => (dispatch

const environment = findEnvironmentInCollection(collectionCopy, collection.activeEnvironmentUid);

_sendCollectionOauth2Request(collection, environment, collectionCopy.runtimeVariables)
_sendCollectionOauth2Request(collectionCopy, environment, collectionCopy.runtimeVariables)
.then((response) => {
if (response?.data?.error) {
toast.error(response?.data?.error);
Expand Down
2 changes: 1 addition & 1 deletion packages/bruno-electron/src/ipc/network/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ const registerNetworkIpc = (mainWindow) => {

const collectionRoot = get(collection, 'root', {});
const _request = collectionRoot?.request;
const request = prepareCollectionRequest(_request, collectionRoot, collectionPath);
const request = prepareCollectionRequest(_request, collection, collectionPath);
request.__bruno__executionMode = 'standalone';
const envVars = getEnvVars(environment);
const processEnvVars = getProcessEnvVars(collectionUid);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { get, each } = require('lodash');
const { setAuthHeaders } = require('./prepare-request');

const prepareCollectionRequest = (request, collectionRoot) => {
const prepareCollectionRequest = (request, collection) => {
const collectionRoot = get(collection, 'root', {});
const headers = {};
let contentTypeDefined = false;
let url = request.url;
Expand Down Expand Up @@ -34,6 +35,8 @@ const prepareCollectionRequest = (request, collectionRoot) => {
};

axiosRequest = setAuthHeaders(axiosRequest, request, collectionRoot);

axiosRequest.globalEnvironmentVariables = collection?.globalEnvironmentVariables;

if (request.script) {
axiosRequest.script = request.script;
Expand Down

0 comments on commit a580f88

Please sign in to comment.