diff --git a/packages/bruno-electron/src/utils/oauth2.js b/packages/bruno-electron/src/utils/oauth2.js index beaee1c21..dd8594728 100644 --- a/packages/bruno-electron/src/utils/oauth2.js +++ b/packages/bruno-electron/src/utils/oauth2.js @@ -141,7 +141,7 @@ const getOAuth2TokenUsingAuthorizationCode = async ({ request, collectionUid, fo if (pkce) { data['code_verifier'] = codeVerifier; } - if (scope) { + if (scope && scope.trim() !== '') { data.scope = scope; } requestCopy.data = qs.stringify(data); @@ -344,7 +344,7 @@ const getOAuth2TokenUsingClientCredentials = async ({ request, collectionUid, fo if (clientSecret && credentialsPlacement !== "basic_auth_header") { data.client_secret = clientSecret; } - if (scope) { + if (scope && scope.trim() !== '') { data.scope = scope; } requestCopy.data = qs.stringify(data); @@ -515,7 +515,7 @@ const getOAuth2TokenUsingPasswordCredentials = async ({ request, collectionUid, if (clientSecret && credentialsPlacement !== "basic_auth_header") { data.client_secret = clientSecret; } - if (scope) { + if (scope && scope.trim() !== '') { data.scope = scope; } requestCopy.data = qs.stringify(data);