fix: permission (#1224)

Reviewed-on: daoyoucloud/tachybase#1224
This commit is contained in:
sealday 2024-06-21 11:01:58 +08:00
parent 68e1ba3012
commit a95d03ec8e
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ export class AuthManager {
return async (ctx: Context & { auth: Auth }, next: Next) => {
const token = ctx.getBearerToken();
if (token && (await ctx.app.authManager.jwt.blacklist?.has(token))) {
return ctx.throw(401, ctx.t('token is not available'));
return ctx.throw(403, ctx.t('token is not available'));
}
const name = ctx.get(this.options.authKey) || this.options.default;

View File

@ -86,7 +86,7 @@ export class UiSchemaStoragePlugin extends Plugin {
});
this.app.acl.allow('uiSchemas', ['getProperties', 'getJsonSchema'], 'loggedIn');
this.app.acl.allow('uiSchemaTemplates', ['get', 'list'], 'loggedIn');
this.app.acl.allow('uiSchemaTemplates', ['get', 'list'], 'public');
}
async load() {