diff --git a/cypress/e2e/2-credentials.cy.ts b/cypress/e2e/2-credentials.cy.ts index ca1ca6e014..008758aef2 100644 --- a/cypress/e2e/2-credentials.cy.ts +++ b/cypress/e2e/2-credentials.cy.ts @@ -236,4 +236,29 @@ describe('Credentials', () => { .find('input') .should('have.value', NEW_QUERY_AUTH_ACCOUNT_NAME); }); + + it('should not show OAuth redirect URL section when OAuth2 credentials are overridden', () => { + cy.intercept('/types/credentials.json', { middleware: true }, (req) => { + req.headers['cache-control'] = 'no-cache, no-store'; + + req.on('response', (res) => { + const credentials = res.body || []; + + const index = credentials.findIndex((c) => c.name === 'slackOAuth2Api'); + + credentials[index] = { + ...credentials[index], + __overwrittenProperties: ['clientId', 'clientSecret'], + }; + }); + }); + + workflowPage.actions.visit(true); + workflowPage.actions.addNodeToCanvas('Slack'); + workflowPage.actions.openNode('Slack'); + workflowPage.getters.nodeCredentialsSelect().click(); + getVisibleSelect().find('li').last().click(); + credentialsModal.getters.credentialAuthTypeRadioButtons().first().click(); + nodeDetailsView.getters.copyInput().should('not.exist'); + }); }); diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue index 3ef3a88a55..530d39ca45 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue @@ -78,7 +78,7 @@ /> { + const properties = this.credentialType.properties.filter((propertyData: INodeProperties) => { if (!this.displayCredentialParameter(propertyData)) { return false; } @@ -444,6 +454,17 @@ export default defineComponent({ !this.credentialType!.__overwrittenProperties.includes(propertyData.name) ); }); + + /** + * If after all credentials overrides are applied only "notice" + * properties are left, do not return them. This will avoid + * showing notices that refer to a property that was overridden. + */ + if (properties.every((p) => p.type === 'notice')) { + return []; + } + + return properties; }, requiredPropertiesFilled(): boolean { for (const property of this.credentialProperties) {