diff --git a/package-lock.json b/package-lock.json index 3e0660e..b113382 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@advanced-rest-client/authorization", - "version": "0.1.11", + "version": "0.1.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 85d7ef9..63a54fa 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/Oauth2MethodMixin.js b/src/Oauth2MethodMixin.js index 6d76c0e..0cec0d9 100644 --- a/src/Oauth2MethodMixin.js +++ b/src/Oauth2MethodMixin.js @@ -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() { diff --git a/src/Validation.js b/src/Validation.js index 4ef9702..a548017 100644 --- a/src/Validation.js +++ b/src/Validation.js @@ -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); }; /**