From c56304f2b5f69aab2fc3cf5a4e8461b45ac69492 Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Mon, 15 Jul 2024 19:04:59 +0800 Subject: [PATCH] fix: token, fixed logic (#1321) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1321 --- .../plugins/@tachybase/plugin-api-keys/src/server/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts b/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts index cce5075fe..021cc94f4 100644 --- a/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts +++ b/packages/plugins/@tachybase/plugin-api-keys/src/server/plugin.ts @@ -27,7 +27,7 @@ export class PluginAPIKeysServer extends Plugin { async (ctx, next) => { const token = ctx.getBearerToken(); // TODO 固定长度判断来优化性能 - if (token && token.length !== 64) { + if (token?.length !== 64) { return await next(); } const key = await repo.findOne({