diff --git a/packages/schemas/src/types/jwt-customizer.ts b/packages/schemas/src/types/jwt-customizer.ts index 640d2d8d3a0..6e42f716cb5 100644 --- a/packages/schemas/src/types/jwt-customizer.ts +++ b/packages/schemas/src/types/jwt-customizer.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; import { Roles, UserSsoIdentities, Organizations } from '../db-entries/index.js'; -import { mfaFactorsGuard } from '../foundations/index.js'; +import { jsonObjectGuard, mfaFactorsGuard } from '../foundations/index.js'; import { jwtCustomizerGuard } from './logto-config/index.js'; import { scopeResponseGuard } from './scope.js'; @@ -41,8 +41,8 @@ export const customJwtFetcherGuard = jwtCustomizerGuard .pick({ script: true, envVars: true }) .required({ script: true }) .extend({ - token: z.record(z.unknown()), - context: z.record(z.unknown()).optional(), + token: jsonObjectGuard, + context: jsonObjectGuard.optional(), }); export type CustomJwtFetcher = z.infer;