From 5065b2ac379a7bf52614d53225a4f5af02dac48d Mon Sep 17 00:00:00 2001 From: naman-bruno Date: Thu, 26 Jun 2025 17:18:29 +0530 Subject: [PATCH] fix: oauth2 scope --- packages/bruno-electron/src/utils/oauth2.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);