Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pass the scope conditionally for OAuth2 Password Credentials #2447

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/bruno-electron/src/ipc/network/oauth2-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ const resolveOAuth2AuthorizationCodeAccessToken = async (request, collectionUid)
redirect_uri: callbackUrl,
client_id: clientId,
client_secret: clientSecret,
scope: scope,
state: state
};
if (scope) {
data['scope'] = scope;
}
if (pkce) {
data['code_verifier'] = codeVerifier;
}
Expand Down Expand Up @@ -88,9 +90,11 @@ const transformClientCredentialsRequest = async (request) => {
const data = {
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret,
scope
client_secret: clientSecret
};
if (scope) {
data.scope = scope;
}
const url = requestCopy?.oauth2?.accessTokenUrl;
return {
data,
Expand All @@ -109,9 +113,11 @@ const transformPasswordCredentialsRequest = async (request) => {
username,
password,
client_id: clientId,
client_secret: clientSecret,
scope
client_secret: clientSecret
};
if (scope) {
data.scope = scope;
}
const url = requestCopy?.oauth2?.accessTokenUrl;
return {
data,
Expand Down