rankrunners-cms 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rankrunners-cms",
3
3
  "type": "module",
4
- "version": "0.0.25",
4
+ "version": "0.0.26",
5
5
  "peerDependencies": {
6
6
  "@puckeditor/core": "^0.21.1",
7
7
  "@tanstack/react-router": "^1.166.6",
@@ -44,6 +44,7 @@ export type UseCaptcha = {
44
44
  captchaError: string | null;
45
45
  captchaProgress: number | null;
46
46
  resetCaptcha: () => void;
47
+ consumeCaptchaToken: () => CapToken | null;
47
48
  };
48
49
 
49
50
  export type CapWorkerMessage = {
@@ -235,12 +235,19 @@ export function useCaptcha(props: CapHookProps = {}): UseCaptcha {
235
235
 
236
236
  const solvingCaptcha = solving || waitingForRetry;
237
237
 
238
+ const consumeCaptchaToken = useCallback(() => {
239
+ const currentToken = token;
240
+ reset();
241
+ return currentToken;
242
+ }, [token, reset]);
243
+
238
244
  return {
239
245
  captchaToken: token?.token ?? null,
240
246
  solvingCaptcha,
241
247
  captchaError: solvingCaptcha ? null : error,
242
248
  captchaProgress: progress,
243
249
  resetCaptcha: reset,
250
+ consumeCaptchaToken,
244
251
  };
245
252
  }
246
253