@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
23 lines • 854 B
text/typescript
import { ReverificationConfig } from "./types/sessionVerification.mjs";
//#region src/authorization-errors.d.ts
type ClerkError<T> = {
clerk_error: T;
};
declare const REVERIFICATION_REASON = "reverification-error";
type ReverificationError<M extends {
metadata?: any;
} = {
metadata: unknown;
}> = ClerkError<{
type: 'forbidden';
reason: typeof REVERIFICATION_REASON;
} & M>;
declare const reverificationError: <MC extends ReverificationConfig>(missingConfig?: MC) => ReverificationError<{
metadata?: {
reverification?: MC;
};
}>;
declare const reverificationErrorResponse: (...args: Parameters<typeof reverificationError>) => Response;
declare const isReverificationHint: (result: any) => result is ReturnType<typeof reverificationError>;
//#endregion
export { isReverificationHint, reverificationError, reverificationErrorResponse };