mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Fix foreign credentials being shown for new nodes (#4622)
* feat: Extract usedCredentials into separate store entry and fix foreign credentials being shown for new nodes * chore: adjust spacing
This commit is contained in:
@@ -870,7 +870,7 @@ export default mixins(
|
||||
}
|
||||
|
||||
if (data.usedCredentials) {
|
||||
this.credentialsStore.addCredentials(data.usedCredentials);
|
||||
this.workflowsStore.setUsedCredentials(data.usedCredentials);
|
||||
}
|
||||
|
||||
const tags = (data.tags || []) as ITag[];
|
||||
@@ -2409,10 +2409,10 @@ export default mixins(
|
||||
}
|
||||
|
||||
if (newNodeData.credentials && this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.WorkflowSharing)) {
|
||||
const foreignCredentials = this.credentialsStore.foreignCredentialsById;
|
||||
const usedCredentials = this.workflowsStore.usedCredentials;
|
||||
newNodeData.credentials = Object.fromEntries(
|
||||
Object.entries(newNodeData.credentials).filter(([_, credential]) => {
|
||||
return credential.id && (!foreignCredentials[credential.id] || foreignCredentials[credential.id]?.currentUserHasAccess);
|
||||
return credential.id && (!usedCredentials[credential.id] || usedCredentials[credential.id]?.currentUserHasAccess);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user