From edad85b92d5c3aac4f5034b554dbdc60cf2e9b31 Mon Sep 17 00:00:00 2001 From: Chareice Date: Thu, 18 Jan 2024 13:52:24 +0800 Subject: [PATCH] chore: acl selectore --- packages/core/server/src/middlewares/acl-selector.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/core/server/src/middlewares/acl-selector.ts b/packages/core/server/src/middlewares/acl-selector.ts index 524041697c..ba72e44bb8 100644 --- a/packages/core/server/src/middlewares/acl-selector.ts +++ b/packages/core/server/src/middlewares/acl-selector.ts @@ -1,13 +1,9 @@ export function AclSelectorMiddleware() { return async (ctx, next) => { const connectionName = ctx.get('x-connection'); - if (connectionName) { - await next(); - } else { - const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; + const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; - const middleware = aclInstance.middleware(); - await middleware(ctx, next); - } + const middleware = aclInstance.middleware(); + await middleware(ctx, next); }; }