UNPKG

@clerk/shared

Version:

Internal package utils used by the Clerk SDKs

19 lines (17 loc) 912 B
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); //#region src/authorization-errors.ts const REVERIFICATION_REASON = "reverification-error"; const reverificationError = (missingConfig) => ({ clerk_error: { type: "forbidden", reason: REVERIFICATION_REASON, metadata: { reverification: missingConfig } } }); const reverificationErrorResponse = (...args) => new Response(JSON.stringify(reverificationError(...args)), { status: 403 }); const isReverificationHint = (result) => { return result && typeof result === "object" && "clerk_error" in result && result.clerk_error?.type === "forbidden" && result.clerk_error?.reason === REVERIFICATION_REASON; }; //#endregion exports.isReverificationHint = isReverificationHint; exports.reverificationError = reverificationError; exports.reverificationErrorResponse = reverificationErrorResponse; //# sourceMappingURL=authorization-errors.js.map