mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Mark as required on subsequent selections
This commit is contained in:
parent
452139f7ec
commit
9b3e9a27b5
|
@ -204,17 +204,23 @@ export const nodeHelpers = mixins(
|
|||
let credentialDisplayName: string;
|
||||
let selectedCredentials: INodeCredentialsDetails;
|
||||
|
||||
const { authenticateWith, genericAuthType, nodeCredentialType } = node.parameters as {
|
||||
authenticateWith: 'none' | 'genericAuth' | 'nodeCredential';
|
||||
genericAuthType: string;
|
||||
nodeCredentialType: string;
|
||||
};
|
||||
|
||||
if (
|
||||
node.type === HTTP_REQUEST_NODE_TYPE &&
|
||||
node.typeVersion === 2 &&
|
||||
node.parameters.authenticateWith === 'genericAuth' &&
|
||||
node.credentials === undefined // @TODO Or if no currently selected generic auth cred
|
||||
authenticateWith === 'genericAuth' &&
|
||||
(
|
||||
node.credentials === undefined ||
|
||||
Object.keys(node.credentials).includes(genericAuthType) === false
|
||||
)
|
||||
) {
|
||||
const { genericAuthType } = node.parameters as { genericAuthType: string };
|
||||
const credentialType = this.getCredentialTypeByName(genericAuthType);
|
||||
|
||||
//
|
||||
|
||||
return {
|
||||
credentials: {
|
||||
[credentialType.name]: [`Credentials for "${credentialType.displayName}" are not set.`],
|
||||
|
@ -225,13 +231,13 @@ export const nodeHelpers = mixins(
|
|||
if (
|
||||
node.type === HTTP_REQUEST_NODE_TYPE &&
|
||||
node.typeVersion === 2 &&
|
||||
node.parameters.authenticateWith === 'nodeCredential' &&
|
||||
node.credentials === undefined // @TODO or if no currently selected service-specific cred
|
||||
authenticateWith === 'nodeCredential' &&
|
||||
nodeCredentialType !== '' &&
|
||||
(
|
||||
node.credentials === undefined ||
|
||||
Object.keys(node.credentials).includes(nodeCredentialType) === false
|
||||
)
|
||||
) {
|
||||
const { nodeCredentialType } = node.parameters as { nodeCredentialType?: string };
|
||||
|
||||
if (!nodeCredentialType) return null;
|
||||
|
||||
const credentialType = this.getCredentialTypeByName(nodeCredentialType);
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue