Skip to content

Commit

Permalink
Merge pull request #11 from advanced-rest-client/fix/W-15791262/clien…
Browse files Browse the repository at this point in the history
…t-secret-optional-field

Fix/w-15791262/client secret optional field
  • Loading branch information
leandrogilcarrano committed May 31, 2024
2 parents f40c557 + 898e534 commit efb52d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@advanced-rest-client/authorization",
"description": "The UI and logic related to HTTP authorization.",
"version": "0.1.11",
"version": "0.1.12",
"license": "Apache-2.0",
"main": "index.js",
"module": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/Oauth2MethodMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ const mxFunction = (base) => {
}

get oauth2ClientSecretRequired() {
const { grantType } = this;
return ['authorization_code'].includes(grantType);
const { grantType, pkce } = this;
return ['authorization_code'].includes(grantType) && !pkce;
}

get oauth2AuthorizationUriRendered() {
Expand Down
4 changes: 2 additions & 2 deletions src/Validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export const validateOauth2AuthImplicit = (element) => {
* @return {Boolean} Validation result
*/
export const validateOauth2AuthCode = (element) => {
const { clientId, clientSecret, authorizationUri, accessTokenUri } = element;
return !!clientId && !!authorizationUri && !!clientSecret && !!accessTokenUri;
const { clientId, clientSecret, authorizationUri, accessTokenUri, pkce = false } = element;
return !!clientId && !!authorizationUri && !!accessTokenUri && (!!clientSecret || pkce);
};

/**
Expand Down

0 comments on commit efb52d0

Please sign in to comment.