mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 23:43:15 +01:00
fix: Pass the scope conditionally for OAuth2 grant types (#2447)
Fixes: #2446. Signed-off-by: Nicolas Nobelis <nicolas@nobelis.eu>
This commit is contained in:
parent
3db7d54aca
commit
d88bb68014
@ -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;
|
||||
}
|
||||
@ -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,
|
||||
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user