fix: token, fixed logic (#1321)

Reviewed-on: daoyoucloud/tachybase#1321
This commit is contained in:
bai.zixv 2024-07-15 19:04:59 +08:00
parent 1ab2f11b89
commit c56304f2b5

View File

@ -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({