From 36efa6ba638c22895fe865db42af545f43e6d54b Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:51:27 +0100 Subject: [PATCH] Update inject-permission.ts --- backend/src/server/plugins/auth/inject-permission.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/server/plugins/auth/inject-permission.ts b/backend/src/server/plugins/auth/inject-permission.ts index 92fbfff1d..084f18198 100644 --- a/backend/src/server/plugins/auth/inject-permission.ts +++ b/backend/src/server/plugins/auth/inject-permission.ts @@ -12,8 +12,8 @@ export const injectPermission = fp(async (server) => { req.permission = { type: ActorType.USER, id: req.auth.userId, - orgId: req.auth.orgId, - authMethod: req.auth.authMethod + orgId: req.auth.orgId, // if the req.auth.authMode is AuthMode.API_KEY, the orgId will be "API_KEY" + authMethod: req.auth.authMethod // if the req.auth.authMode is AuthMode.API_KEY, the authMethod will be null }; } else if (req.auth.actor === ActorType.IDENTITY) { req.permission = {