mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix: When editing nodes only show the credentials in the dropdown that the user is allowed to use in that workflow (#9718)
This commit is contained in:
@@ -52,6 +52,14 @@ export class CredentialsController {
|
||||
});
|
||||
}
|
||||
|
||||
@Get('/for-workflow')
|
||||
async getProjectCredentials(req: CredentialRequest.ForWorkflow) {
|
||||
const options = z
|
||||
.union([z.object({ workflowId: z.string() }), z.object({ projectId: z.string() })])
|
||||
.parse(req.query);
|
||||
return await this.credentialsService.getCredentialsAUserCanUseInAWorkflow(req.user, options);
|
||||
}
|
||||
|
||||
@Get('/new')
|
||||
async generateUniqueName(req: CredentialRequest.NewName) {
|
||||
const requestedName = req.query.name ?? config.getEnv('credentials.defaultName');
|
||||
|
||||
Reference in New Issue
Block a user