From cec8238b646deb207d64cd22b119b94db24f7be4 Mon Sep 17 00:00:00 2001 From: Thanasis G <96360514+gthanasis@users.noreply.github.com> Date: Mon, 18 May 2026 11:53:03 +0300 Subject: [PATCH] fix(editor): Load credentials when opening node credential picker (#30463) --- .../credentials/components/NodeCredentials.test.ts | 9 +++++++++ .../features/credentials/components/NodeCredentials.vue | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.test.ts b/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.test.ts index b4c751f7598..644f8cc71d9 100644 --- a/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.test.ts +++ b/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.test.ts @@ -220,6 +220,15 @@ describe('NodeCredentials', () => { expect(screen.queryByText('OpenAi account')).toBeInTheDocument(); }); + it('should refresh credentials from the server when mounted on an existing node', () => { + ndvStore.activeNode = httpNode; + credentialsStore.state.credentials = {}; + + renderComponent(); + + expect(credentialsStore.fetchAllCredentials).toHaveBeenCalled(); + }); + it('should ignore managed credentials in the dropdown if active node is the HTTP node', async () => { ndvStore.activeNode = httpNode; credentialsStore.state.credentials = { diff --git a/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.vue b/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.vue index 03627fb8b47..f49d3e51a0b 100644 --- a/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.vue +++ b/packages/frontend/editor-ui/src/features/credentials/components/NodeCredentials.vue @@ -316,6 +316,10 @@ onMounted(() => { ndvEventBus.on('credential.createNew', onCreateAndAssignNewCredential); + void credentialsStore.fetchAllCredentials({ + projectId: projectsStore.currentProject?.id, + }); + void aiGateway.fetchConfig(); // Clear stale AI Gateway managed credentials if the feature is disabled