Skip to content

Commit 9b5f589

Browse files
Copilothotlong
andcommitted
Fix hook registration in plugin-security: add kernel.use fallback
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 6188aae commit 9b5f589

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • packages/foundation/plugin-security/src

packages/foundation/plugin-security/src/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ export class ObjectQLSecurityPlugin implements RuntimePlugin {
174174
const registerHook = (name: string, handler: any) => {
175175
if (typeof ctx.hook === 'function') {
176176
ctx.hook(name, handler);
177+
} else if (typeof (kernel as any).use === 'function') {
178+
(kernel as any).use(name, handler);
177179
} else if (typeof (kernel as any).hooks?.register === 'function') {
178180
(kernel as any).hooks.register(name, handler);
179181
} else {

0 commit comments

Comments
 (0)