UNPKG

@clerk/shared

Version:

Internal package utils used by the Clerk SDKs

24 lines (21 loc) 1.12 kB
import * as _clerk_types from '@clerk/types'; import { CheckAuthorizationWithCustomPermissions, ReverificationConfig, SessionVerificationLevel } from '@clerk/types'; type AuthorizationOptions = { userId: string | null | undefined; orgId: string | null | undefined; orgRole: string | null | undefined; orgPermissions: string[] | null | undefined; factorVerificationAge: [number, number] | null; }; declare const validateReverificationConfig: (config: ReverificationConfig | undefined | null) => false | (() => { level: SessionVerificationLevel; afterMinutes: _clerk_types.SessionVerificationAfterMinutes; }); /** * Creates a function for comprehensive user authorization checks. * Combines organization-level and reverification authentication checks. * The returned function authorizes if both checks pass, or if at least one passes * when the other is indeterminate. Fails if userId is missing. */ declare const createCheckAuthorization: (options: AuthorizationOptions) => CheckAuthorizationWithCustomPermissions; export { createCheckAuthorization, validateReverificationConfig };