Skip to content

Commit db76fb3

Browse files
committed
fix: fix ForbiddenError returning information about record
1 parent 6ab01b5 commit db76fb3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/services/action-error-handler/action-error-handler.ts

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ const actionErrorHandler = (
5151

5252
const recordJson = record?.toJSON?.(currentAdmin)
5353

54+
if (error instanceof ForbiddenError && recordJson) {
55+
recordJson.params = {}
56+
recordJson.title = ''
57+
recordJson.populated = {}
58+
}
59+
5460
notice = {
5561
message: baseMessage,
5662
type: 'error',

0 commit comments

Comments
 (0)