From fcecd08bfc650271e5949c5fb3224660fb4a1dd4 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Wed, 11 Dec 2024 14:02:13 +0300 Subject: [PATCH] Fix \`resolveUserFn\` typo authorization-authentication.mdx (#6093) --- .../src/pages/docs/gateway/authorization-authentication.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/web/docs/src/pages/docs/gateway/authorization-authentication.mdx b/packages/web/docs/src/pages/docs/gateway/authorization-authentication.mdx index 81abcab0c..a680ad53e 100644 --- a/packages/web/docs/src/pages/docs/gateway/authorization-authentication.mdx +++ b/packages/web/docs/src/pages/docs/gateway/authorization-authentication.mdx @@ -629,7 +629,7 @@ export const gatewayConfig = defineConfig({ // Then set generic auth plugin to use granular mode mode: 'protect-granular', // Set where to extract the payload - resolveUser: ctx => ctx.jwt?.payload, + resolveUserFn: ctx => ctx.jwt?.payload, // If you want to continue execution even if some fields are rejected rejectUnauthenticated: false } @@ -674,11 +674,10 @@ this behavior by providing a custom `extractScopes` function. ```ts { - resolveUserFn, validateUser, mode: 'protect-granular', // Set where to extract the payload - resolveUser: ctx => ctx.jwt?.payload, + resolveUserFn: ctx => ctx.jwt?.payload, extractScopes: jwtPayload => jwtPayload?.scopes // Expected to return an array of strings } ```