@prosopo/procaptcha-puzzle 2.10.24 → 2.10.25

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/procaptcha-puzzle@2.10.24 build:cjs
2
+ > @prosopo/procaptcha-puzzle@2.10.25 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -47,7 +47,7 @@ Build end
47
47
  rendering chunks...
48
48
  dist/cjs/index.cjs  0.27 kB
49
49
  dist/cjs/components/ProcaptchaPuzzle.cjs  0.70 kB
50
- dist/cjs/components/ProcaptchaWidget.cjs  6.92 kB
50
+ dist/cjs/components/ProcaptchaWidget.cjs  7.48 kB
51
51
  dist/cjs/components/PuzzleCanvas.cjs 10.09 kB
52
52
  dist/cjs/services/Manager.cjs 10.17 kB
53
- ✓ built in 277ms
53
+ ✓ built in 253ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha-puzzle@2.10.24 build:tsc
2
+ > @prosopo/procaptcha-puzzle@2.10.25 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 3:30:02 PM - Projects in this build:
5
+ 8:44:36 AM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -20,37 +20,37 @@
20
20
  * ../procaptcha-common/tsconfig.json
21
21
  * tsconfig.json
22
22
 
23
- 3:30:02 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
23
+ 8:44:36 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/vite.frontend.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
24
24
 
25
- 3:30:02 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
25
+ 8:44:36 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
26
26
 
27
- 3:30:02 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
27
+ 8:44:36 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
28
28
 
29
- 3:30:03 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
29
+ 8:44:36 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
30
30
 
31
- 3:30:03 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/provider/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
31
+ 8:44:36 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/utils.ts' is older than output '../types/tsconfig.tsbuildinfo'
32
32
 
33
- 3:30:03 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
33
+ 8:44:36 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
34
34
 
35
- 3:30:03 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
35
+ 8:44:36 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
36
36
 
37
- 3:30:03 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/utils/batches.ts' is older than output '../common/tsconfig.tsbuildinfo'
37
+ 8:44:36 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/utils/batches.ts' is older than output '../common/tsconfig.tsbuildinfo'
38
38
 
39
- 3:30:03 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/index.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
39
+ 8:44:36 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
40
40
 
41
- 3:30:03 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/constants.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
41
+ 8:44:36 AM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
42
42
 
43
- 3:30:03 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
43
+ 8:44:36 AM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/sources/timezone.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
44
44
 
45
- 3:30:03 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
45
+ 8:44:36 AM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
46
46
 
47
- 3:30:03 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
47
+ 8:44:36 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
48
48
 
49
- 3:30:03 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
49
+ 8:44:36 AM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/workers/index.ts' is older than output '../account/tsconfig.tsbuildinfo'
50
50
 
51
- 3:30:03 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/tests/defaultEvents.test.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
51
+ 8:44:36 AM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/tests/form.test.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
52
52
 
53
- 3:30:03 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
53
+ 8:44:36 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
54
54
 
55
- 3:30:03 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-puzzle/tsconfig.json'...
55
+ 8:44:36 AM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-puzzle/tsconfig.json'...
56
56
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha-puzzle@2.10.24 build
2
+ > @prosopo/procaptcha-puzzle@2.10.25 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-puzzle@2.10.24 build:cross-env
6
+ > @prosopo/procaptcha-puzzle@2.10.25 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -51,7 +51,7 @@ Build end
51
51
  rendering chunks...
52
52
  dist/index.js  0.14 kB
53
53
  dist/components/ProcaptchaPuzzle.js  0.34 kB
54
- dist/components/ProcaptchaWidget.js  6.73 kB
54
+ dist/components/ProcaptchaWidget.js  7.28 kB
55
55
  dist/components/PuzzleCanvas.js  9.81 kB
56
56
  dist/services/Manager.js 10.01 kB
57
- ✓ built in 243ms
57
+ ✓ built in 264ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @prosopo/procaptcha-puzzle
2
2
 
3
+ ## 2.10.25
4
+ ### Patch Changes
5
+
6
+ - 18d0287: fix(procaptcha-frictionless,procaptcha-pow,procaptcha-puzzle,procaptcha-react): auto-recover from `CAPTCHA.NO_SESSION_FOUND` on the inner widget without asking the user to click the checkbox a second time, and without dropping the click coordinates that would otherwise land in the solution salt as `(0, 0)`.
7
+
8
+ Motivation. The in-flight dedupe added in the previous change only collapses `/captcha/{type}` POSTs that overlap in flight. A duplicate POST that fires ~1 s after the first has already settled (observed on iPhone WKWebView, incident 2026-07-01 21:23 UTC) still lands on a consumed session and returns `NO_SESSION_FOUND`. The pre-existing recovery for that case was a `setTimeout(restart, 100)` that tore the whole widget down and lost the checkbox click position.
9
+
10
+ - `ProcaptchaProps` gains two optional props: `onSessionInvalidated(x?, y?)` and `startCoords: { x, y }`. Widgets not mounted under a recovery-aware parent still fall back to `frictionlessState.restart()`.
11
+ - `procaptcha-pow`, `procaptcha-puzzle`, and `procaptcha-react` widgets now track the last `manager.start(x, y)` coords in a ref (either from the checkbox click or from `startCoords`) and, on the first `CAPTCHA.NO_SESSION_FOUND`, invoke `onSessionInvalidated(x, y)` instead of calling `restart()`. A per-instance ref makes it strictly one-shot — a second failure falls back to the existing restart path so a persistently broken session doesn't loop.
12
+ - `ProcaptchaFrictionless` wires `onSessionInvalidated` through to each inner widget: it stashes the retry coords in a ref, re-runs its own `start()` (which re-invokes `/frictionless` and mints a fresh sessionId), then re-mounts the inner widget with `autoStart={true}` and `startCoords={x, y}`. The inner widget auto-fires `manager.start(x, y)` on mount so the eventual submit still embeds the real checkbox click position in the salt.
13
+ - The recovery decision (one-shot fire, coord validation — `(0, 0)` and partial pairs are discarded because they're what an `autoStart` mount or an untrusted pointer event emits rather than a real click, and the consume-and-clear pending-coords ref) is extracted into `sessionInvalidatedRecovery.ts` with dedicated unit tests.
14
+ - Updated dependencies [18d0287]
15
+ - @prosopo/types@4.9.3
16
+ - @prosopo/api@3.5.10
17
+ - @prosopo/procaptcha-common@2.11.4
18
+
3
19
  ## 2.10.24
4
20
  ### Patch Changes
5
21
 
@@ -32,6 +32,8 @@ const Procaptcha = (props) => {
32
32
  () => hpRef.current?.value || void 0
33
33
  )
34
34
  );
35
+ const lastCoordsRef = react.useRef(null);
36
+ const sessionInvalidatedFiredRef = react.useRef(false);
35
37
  react.useEffect(() => {
36
38
  if (config.language) {
37
39
  if (i18n) {
@@ -47,35 +49,43 @@ const Procaptcha = (props) => {
47
49
  }
48
50
  }, [i18n, config.language]);
49
51
  react.useEffect(() => {
50
- if (props.autoStart) {
51
- setLoading(true);
52
- setShowRetry(false);
53
- manager.current.start().then(
54
- (challenge) => {
55
- if (challenge) {
56
- setChallengeData(challenge);
57
- setPuzzlePhase("dragging");
58
- }
59
- setLoading(false);
60
- },
61
- () => setLoading(false)
62
- );
63
- }
64
- }, [props.autoStart]);
52
+ if (!props.autoStart) return;
53
+ setLoading(true);
54
+ setShowRetry(false);
55
+ const coords = props.startCoords;
56
+ lastCoordsRef.current = coords ?? null;
57
+ manager.current.start(coords?.x ?? 0, coords?.y ?? 0).then(
58
+ (challenge) => {
59
+ if (challenge) {
60
+ setChallengeData(challenge);
61
+ setPuzzlePhase("dragging");
62
+ }
63
+ setLoading(false);
64
+ },
65
+ () => setLoading(false)
66
+ );
67
+ }, [props.autoStart, props.startCoords]);
65
68
  react.useEffect(() => {
66
69
  if (!state.error) return void 0;
67
70
  setLoading(false);
68
71
  setPuzzlePhase("checkbox");
69
72
  setChallengeData(null);
70
73
  setShowRetry(false);
71
- if (state.error.key === "CAPTCHA.NO_SESSION_FOUND" && frictionlessState) {
74
+ if (state.error.key !== "CAPTCHA.NO_SESSION_FOUND") return void 0;
75
+ if (props.onSessionInvalidated && !sessionInvalidatedFiredRef.current) {
76
+ sessionInvalidatedFiredRef.current = true;
77
+ const coords = lastCoordsRef.current;
78
+ props.onSessionInvalidated(coords?.x, coords?.y);
79
+ return void 0;
80
+ }
81
+ if (frictionlessState) {
72
82
  const timer = setTimeout(() => {
73
83
  frictionlessState.restart();
74
84
  }, 100);
75
85
  return () => clearTimeout(timer);
76
86
  }
77
87
  return void 0;
78
- }, [state.error, frictionlessState]);
88
+ }, [state.error, frictionlessState, props.onSessionInvalidated]);
79
89
  react.useEffect(() => {
80
90
  if (config.mode === types.ModeEnum.invisible) {
81
91
  const handleExecuteEvent = async () => {
@@ -189,6 +199,7 @@ const Procaptcha = (props) => {
189
199
  x = mouseOrTouchEvent.clientX;
190
200
  y = mouseOrTouchEvent.clientY;
191
201
  }
202
+ lastCoordsRef.current = { x, y };
192
203
  const challenge = await manager.current.start(x, y);
193
204
  if (challenge) {
194
205
  setChallengeData(challenge);
@@ -1 +1 @@
1
- {"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAGN,KAAK,eAAe,EAEpB,MAAM,gBAAgB,CAAC;AAWxB,QAAA,MAAM,UAAU,UAAW,eAAe,qDAkPzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAGN,KAAK,eAAe,EAEpB,MAAM,gBAAgB,CAAC;AAWxB,QAAA,MAAM,UAAU,UAAW,eAAe,qDA+PzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -31,6 +31,8 @@ const Procaptcha = (props) => {
31
31
  () => hpRef.current?.value || void 0
32
32
  )
33
33
  );
34
+ const lastCoordsRef = useRef(null);
35
+ const sessionInvalidatedFiredRef = useRef(false);
34
36
  useEffect(() => {
35
37
  if (config.language) {
36
38
  if (i18n) {
@@ -46,35 +48,43 @@ const Procaptcha = (props) => {
46
48
  }
47
49
  }, [i18n, config.language]);
48
50
  useEffect(() => {
49
- if (props.autoStart) {
50
- setLoading(true);
51
- setShowRetry(false);
52
- manager.current.start().then(
53
- (challenge) => {
54
- if (challenge) {
55
- setChallengeData(challenge);
56
- setPuzzlePhase("dragging");
57
- }
58
- setLoading(false);
59
- },
60
- () => setLoading(false)
61
- );
62
- }
63
- }, [props.autoStart]);
51
+ if (!props.autoStart) return;
52
+ setLoading(true);
53
+ setShowRetry(false);
54
+ const coords = props.startCoords;
55
+ lastCoordsRef.current = coords ?? null;
56
+ manager.current.start(coords?.x ?? 0, coords?.y ?? 0).then(
57
+ (challenge) => {
58
+ if (challenge) {
59
+ setChallengeData(challenge);
60
+ setPuzzlePhase("dragging");
61
+ }
62
+ setLoading(false);
63
+ },
64
+ () => setLoading(false)
65
+ );
66
+ }, [props.autoStart, props.startCoords]);
64
67
  useEffect(() => {
65
68
  if (!state.error) return void 0;
66
69
  setLoading(false);
67
70
  setPuzzlePhase("checkbox");
68
71
  setChallengeData(null);
69
72
  setShowRetry(false);
70
- if (state.error.key === "CAPTCHA.NO_SESSION_FOUND" && frictionlessState) {
73
+ if (state.error.key !== "CAPTCHA.NO_SESSION_FOUND") return void 0;
74
+ if (props.onSessionInvalidated && !sessionInvalidatedFiredRef.current) {
75
+ sessionInvalidatedFiredRef.current = true;
76
+ const coords = lastCoordsRef.current;
77
+ props.onSessionInvalidated(coords?.x, coords?.y);
78
+ return void 0;
79
+ }
80
+ if (frictionlessState) {
71
81
  const timer = setTimeout(() => {
72
82
  frictionlessState.restart();
73
83
  }, 100);
74
84
  return () => clearTimeout(timer);
75
85
  }
76
86
  return void 0;
77
- }, [state.error, frictionlessState]);
87
+ }, [state.error, frictionlessState, props.onSessionInvalidated]);
78
88
  useEffect(() => {
79
89
  if (config.mode === ModeEnum.invisible) {
80
90
  const handleExecuteEvent = async () => {
@@ -188,6 +198,7 @@ const Procaptcha = (props) => {
188
198
  x = mouseOrTouchEvent.clientX;
189
199
  y = mouseOrTouchEvent.clientY;
190
200
  }
201
+ lastCoordsRef.current = { x, y };
191
202
  const challenge = await manager.current.start(x, y);
192
203
  if (challenge) {
193
204
  setChallengeData(challenge);
@@ -1 +1 @@
1
- {"version":3,"file":"ProcaptchaWidget.js","sourceRoot":"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C9B,iBAAiB,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;wBACpC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAC3B,CAAC;wBACF,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;wBACzC,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;oBAC1C,CAAC;yBAAM,IACN,SAAS,IAAI,iBAAiB;wBAC9B,SAAS,IAAI,iBAAiB,EAC7B,CAAC;wBACF,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC;wBAC9B,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC;oBAC/B,CAAC;oBAED,aAAa,CAAC,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;oBACjC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAEpD,IAAI,SAAS,EAAE,CAAC;wBACf,gBAAgB,CAAC,SAAS,CAAC,CAAC;wBAC5B,cAAc,CAAC,UAAU,CAAC,CAAC;oBAC5B,CAAC;oBAED,UAAU,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC,EACD,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,EAC3D,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,gBAChB,gBAAgB,EAC3B,OAAO,EAAE,OAAO,IAAI,WAAW,KAAK,YAAY,GAC/C,CACF,IACC,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/procaptcha-puzzle",
3
- "version": "2.10.24",
3
+ "version": "2.10.25",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -30,11 +30,11 @@
30
30
  "browserslist": ["> 0.5%, last 2 versions, not dead"],
31
31
  "dependencies": {
32
32
  "@polkadot/util": "13.5.7",
33
- "@prosopo/api": "3.5.9",
33
+ "@prosopo/api": "3.5.10",
34
34
  "@prosopo/common": "3.1.43",
35
35
  "@prosopo/locale": "3.2.6",
36
- "@prosopo/procaptcha-common": "2.11.3",
37
- "@prosopo/types": "4.9.2",
36
+ "@prosopo/procaptcha-common": "2.11.4",
37
+ "@prosopo/types": "4.9.3",
38
38
  "@prosopo/util": "3.3.3",
39
39
  "@prosopo/util-crypto": "13.5.30",
40
40
  "@prosopo/widget-skeleton": "2.8.4",
@@ -57,6 +57,10 @@ const Procaptcha = (props: ProcaptchaProps) => {
57
57
  () => hpRef.current?.value || undefined,
58
58
  ),
59
59
  );
60
+ // See ProcaptchaWidget (procaptcha-pow) — same session-invalidation
61
+ // recovery contract with coords preservation across a re-mint.
62
+ const lastCoordsRef = useRef<{ x: number; y: number } | null>(null);
63
+ const sessionInvalidatedFiredRef = useRef(false);
60
64
 
61
65
  useEffect(() => {
62
66
  if (config.language) {
@@ -74,21 +78,22 @@ const Procaptcha = (props: ProcaptchaProps) => {
74
78
  }, [i18n, config.language]);
75
79
 
76
80
  useEffect(() => {
77
- if (props.autoStart) {
78
- setLoading(true);
79
- setShowRetry(false);
80
- manager.current.start().then(
81
- (challenge) => {
82
- if (challenge) {
83
- setChallengeData(challenge);
84
- setPuzzlePhase("dragging");
85
- }
86
- setLoading(false);
87
- },
88
- () => setLoading(false),
89
- );
90
- }
91
- }, [props.autoStart]);
81
+ if (!props.autoStart) return;
82
+ setLoading(true);
83
+ setShowRetry(false);
84
+ const coords = props.startCoords;
85
+ lastCoordsRef.current = coords ?? null;
86
+ manager.current.start(coords?.x ?? 0, coords?.y ?? 0).then(
87
+ (challenge) => {
88
+ if (challenge) {
89
+ setChallengeData(challenge);
90
+ setPuzzlePhase("dragging");
91
+ }
92
+ setLoading(false);
93
+ },
94
+ () => setLoading(false),
95
+ );
96
+ }, [props.autoStart, props.startCoords]);
92
97
 
93
98
  useEffect(() => {
94
99
  if (!state.error) return undefined;
@@ -96,14 +101,21 @@ const Procaptcha = (props: ProcaptchaProps) => {
96
101
  setPuzzlePhase("checkbox");
97
102
  setChallengeData(null);
98
103
  setShowRetry(false);
99
- if (state.error.key === "CAPTCHA.NO_SESSION_FOUND" && frictionlessState) {
104
+ if (state.error.key !== "CAPTCHA.NO_SESSION_FOUND") return undefined;
105
+ if (props.onSessionInvalidated && !sessionInvalidatedFiredRef.current) {
106
+ sessionInvalidatedFiredRef.current = true;
107
+ const coords = lastCoordsRef.current;
108
+ props.onSessionInvalidated(coords?.x, coords?.y);
109
+ return undefined;
110
+ }
111
+ if (frictionlessState) {
100
112
  const timer = setTimeout(() => {
101
113
  frictionlessState.restart();
102
114
  }, 100);
103
115
  return () => clearTimeout(timer);
104
116
  }
105
117
  return undefined;
106
- }, [state.error, frictionlessState]);
118
+ }, [state.error, frictionlessState, props.onSessionInvalidated]);
107
119
 
108
120
  // Add event listener for the execute event (works for invisible mode)
109
121
  useEffect(() => {
@@ -256,6 +268,7 @@ const Procaptcha = (props: ProcaptchaProps) => {
256
268
  y = mouseOrTouchEvent.clientY;
257
269
  }
258
270
 
271
+ lastCoordsRef.current = { x, y };
259
272
  const challenge = await manager.current.start(x, y);
260
273
 
261
274
  if (challenge) {