New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@clerk/shared

Package Overview
Dependencies
Maintainers
8
Versions
2194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clerk/shared - npm Package Compare versions

Comparing version 2.22.0-snapshot.v20250217155330 to 2.22.0-snapshot.v20250218113640

dist/chunk-FBBUCSZA.mjs

4

dist/index.js

@@ -1211,3 +1211,3 @@ "use strict";

// src/versionSelector.ts
var versionSelector = (clerkJSVersion, packageVersion = "5.53.0-snapshot.v20250217155330") => {
var versionSelector = (clerkJSVersion, packageVersion = "5.53.0-snapshot.v20250218113640") => {
if (clerkJSVersion) {

@@ -1219,3 +1219,3 @@ return clerkJSVersion;

if (prereleaseTag === "snapshot") {
return "5.53.0-snapshot.v20250217155330";
return "5.53.0-snapshot.v20250218113640";
}

@@ -1222,0 +1222,0 @@ return prereleaseTag;

@@ -280,3 +280,3 @@ "use strict";

// src/versionSelector.ts
var versionSelector = (clerkJSVersion, packageVersion = "5.53.0-snapshot.v20250217155330") => {
var versionSelector = (clerkJSVersion, packageVersion = "5.53.0-snapshot.v20250218113640") => {
if (clerkJSVersion) {

@@ -288,3 +288,3 @@ return clerkJSVersion;

if (prereleaseTag === "snapshot") {
return "5.53.0-snapshot.v20250217155330";
return "5.53.0-snapshot.v20250218113640";
}

@@ -291,0 +291,0 @@ return prereleaseTag;

@@ -512,4 +512,16 @@ import React, { PropsWithChildren } from 'react';

throwOnCancel?: boolean;
/**
* Determines if the reverification process should be controlled by the consumer. Defaults to `false`.
*/
controlled?: boolean;
};
type UseReverificationResult<Fetcher extends (...args: any[]) => Promise<any> | undefined, Options extends UseReverificationOptions> = readonly [(...args: Parameters<Fetcher>) => Promise<ExcludeClerkError<Awaited<ReturnType<Fetcher>>, Options>>];
type UseReverificationResult<Fetcher extends (...args: any[]) => Promise<any> | undefined, Options extends UseReverificationOptions> = [
(...args: Parameters<Fetcher>) => Promise<ExcludeClerkError<Awaited<ReturnType<Fetcher>>, Options>>,
{
isReVerificationInProgress: boolean;
verificationLevel: string | undefined;
cancelReverification: () => void;
reverificationCompleted: () => void;
}
];
/**

@@ -516,0 +528,0 @@ * The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry.

@@ -832,15 +832,14 @@ "use strict";

const isValidMetadata = validateReverificationConfig(result.clerk_error.metadata?.reverification);
params.openUIComponent?.({
level: isValidMetadata ? isValidMetadata().level : void 0,
afterVerification() {
resolvers.resolve(true);
},
afterVerificationCancelled() {
resolvers.reject(
new ClerkRuntimeError("User cancelled attempted verification", {
code: "reverification_cancelled"
})
);
}
params.setLevel?.(isValidMetadata ? isValidMetadata().level : void 0);
params.setReverificationInProgress?.(true);
params.setReverificationCompleted?.(() => {
return () => resolvers.resolve(true);
});
params.setReverificationCancel?.(() => {
return () => resolvers.reject(
new ClerkRuntimeError("User cancelled attempted verification", {
code: "reverification_cancelled"
})
);
});
try {

@@ -856,2 +855,4 @@ await resolvers.promise;

return null;
} finally {
params.setReverificationInProgress?.(true);
}

@@ -866,17 +867,58 @@ result = await resolveResult(fetcher(...args));

function useReverification(fetcher, options) {
const { __internal_openReverification } = useClerk();
const optionsWithDefaults = {
controlled: false,
...options
};
const clerk = useClerk();
const fetcherRef = (0, import_react6.useRef)(fetcher);
const optionsRef = (0, import_react6.useRef)(options);
const optionsRef = (0, import_react6.useRef)(optionsWithDefaults);
const [verificationLevel, setVerificationLevel] = (0, import_react6.useState)(void 0);
const [isReVerificationInProgress, setIsReVerificationInProgress] = (0, import_react6.useState)(false);
const [reverificationCancel, setReverificationCancel] = (0, import_react6.useState)(() => {
});
const [reverificationCompleted, setReverificationCompleted] = (0, import_react6.useState)(() => {
});
const handleReverification = (0, import_react6.useMemo)(() => {
const handler = createReverificationHandler({
openUIComponent: __internal_openReverification,
setLevel: setVerificationLevel,
setReverificationInProgress: setIsReVerificationInProgress,
setReverificationCancel,
setReverificationCompleted,
...optionsRef.current
})(fetcherRef.current);
return [handler];
}, [__internal_openReverification, fetcherRef.current, optionsRef.current]);
return handler;
}, []);
(0, import_react6.useEffect)(() => {
if (!optionsWithDefaults.controlled && isReVerificationInProgress) {
clerk.__internal_openReverification({
level: verificationLevel || void 0,
afterVerification() {
reverificationCompleted();
},
afterVerificationCancelled() {
reverificationCancel();
}
});
}
}, [
verificationLevel,
clerk,
isReVerificationInProgress,
optionsWithDefaults.controlled,
reverificationCancel,
reverificationCompleted
]);
useSafeLayoutEffect(() => {
fetcherRef.current = fetcher;
optionsRef.current = options;
optionsRef.current = optionsWithDefaults;
});
return handleReverification;
return [
handleReverification,
{
isReVerificationInProgress,
verificationLevel,
cancelReverification: reverificationCancel,
reverificationCompleted
}
];
}

@@ -883,0 +925,0 @@ // Annotate the CommonJS export names for ESM import in node:

@@ -27,3 +27,3 @@ "use strict";

module.exports = __toCommonJS(versionSelector_exports);
var versionSelector = (clerkJSVersion, packageVersion = "5.53.0-snapshot.v20250217155330") => {
var versionSelector = (clerkJSVersion, packageVersion = "5.53.0-snapshot.v20250218113640") => {
if (clerkJSVersion) {

@@ -35,3 +35,3 @@ return clerkJSVersion;

if (prereleaseTag === "snapshot") {
return "5.53.0-snapshot.v20250217155330";
return "5.53.0-snapshot.v20250218113640";
}

@@ -38,0 +38,0 @@ return prereleaseTag;

{
"name": "@clerk/shared",
"version": "2.22.0-snapshot.v20250217155330",
"version": "2.22.0-snapshot.v20250218113640",
"description": "Internal package utils used by the Clerk SDKs",

@@ -128,3 +128,3 @@ "repository": {

"swr": "^2.2.0",
"@clerk/types": "^4.47.0-snapshot.v20250217155330"
"@clerk/types": "^4.46.1-snapshot.v20250218113640"
},

@@ -131,0 +131,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc