Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: make policy error public #19374

Merged
merged 6 commits into from Feb 9, 2024
Merged
4 changes: 4 additions & 0 deletions packages/core/core/src/services/server/compose-endpoint.ts
Expand Up @@ -44,6 +44,10 @@ const createAuthorizeMiddleware =
}

if (error instanceof errors.ForbiddenError) {
// allow PolicyError as an exception to throw a publicly visible message in the API
if (error instanceof errors.PolicyError) {
throw error;
}
return ctx.forbidden();
}

Expand Down