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 credentialDisplayName: string;
|
||||||
let selectedCredentials: INodeCredentialsDetails;
|
let selectedCredentials: INodeCredentialsDetails;
|
||||||
|
|
||||||
|
const { authenticateWith, genericAuthType, nodeCredentialType } = node.parameters as {
|
||||||
|
authenticateWith: 'none' | 'genericAuth' | 'nodeCredential';
|
||||||
|
genericAuthType: string;
|
||||||
|
nodeCredentialType: string;
|
||||||
|
};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
node.type === HTTP_REQUEST_NODE_TYPE &&
|
node.type === HTTP_REQUEST_NODE_TYPE &&
|
||||||
node.typeVersion === 2 &&
|
node.typeVersion === 2 &&
|
||||||
node.parameters.authenticateWith === 'genericAuth' &&
|
authenticateWith === 'genericAuth' &&
|
||||||
node.credentials === undefined // @TODO Or if no currently selected generic auth cred
|
(
|
||||||
|
node.credentials === undefined ||
|
||||||
|
Object.keys(node.credentials).includes(genericAuthType) === false
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
const { genericAuthType } = node.parameters as { genericAuthType: string };
|
|
||||||
const credentialType = this.getCredentialTypeByName(genericAuthType);
|
const credentialType = this.getCredentialTypeByName(genericAuthType);
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
credentials: {
|
credentials: {
|
||||||
[credentialType.name]: [`Credentials for "${credentialType.displayName}" are not set.`],
|
[credentialType.name]: [`Credentials for "${credentialType.displayName}" are not set.`],
|
||||||
|
@ -225,13 +231,13 @@ export const nodeHelpers = mixins(
|
||||||
if (
|
if (
|
||||||
node.type === HTTP_REQUEST_NODE_TYPE &&
|
node.type === HTTP_REQUEST_NODE_TYPE &&
|
||||||
node.typeVersion === 2 &&
|
node.typeVersion === 2 &&
|
||||||
node.parameters.authenticateWith === 'nodeCredential' &&
|
authenticateWith === 'nodeCredential' &&
|
||||||
node.credentials === undefined // @TODO or if no currently selected service-specific cred
|
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);
|
const credentialType = this.getCredentialTypeByName(nodeCredentialType);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue