0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor: keep origin customJwtFetcherGuard

This commit is contained in:
Darcy Ye 2024-03-20 23:49:36 +08:00
parent 45a7ee17aa
commit b2e00df1b9
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610

View file

@ -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<typeof customJwtFetcherGuard>;