diff --git a/packages/bruno-electron/src/ipc/network/oauth2-authorization-code-helper.js b/packages/bruno-electron/src/ipc/network/oauth2-authorization-code-helper.js index 303af81709..47fc059941 100644 --- a/packages/bruno-electron/src/ipc/network/oauth2-authorization-code-helper.js +++ b/packages/bruno-electron/src/ipc/network/oauth2-authorization-code-helper.js @@ -25,7 +25,10 @@ const getOAuth2AuthorizationCode = (request) => { return new Promise(async (resolve, reject) => { const { oauth2 } = request; const { callbackUrl, clientId, authorizationUrl, scope } = oauth2; - const authorizationUrlWithQueryParams = `${authorizationUrl}?client_id=${clientId}&redirect_uri=${callbackUrl}&response_type=code&scope=${scope}`; + const authorizationUrlWithQueryParams = + `${authorizationUrl}` + + (authorizationUrl.indexOf('?') > -1 ? '&' : '?') + + `client_id=${clientId}&redirect_uri=${callbackUrl}&response_type=code&scope=${scope}`; try { const code = await authorizeUserInWindow({ authorizeUrl: authorizationUrlWithQueryParams, callbackUrl }); resolve(code);