From 8d8f602856af9548e9b49dfe9da5faf111d7f691 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 24 Sep 2024 13:00:40 +0200 Subject: [PATCH] update turnstile-types --- package-lock.json | 14 +++++++------- package.json | 2 +- src/index.tsx | 14 ++++---------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index f98fc02..a004299 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@types/react": "^18.0.21", "prettier": "^2.7.1", - "turnstile-types": "^1.2.2", + "turnstile-types": "^1.2.3", "typescript": "^4.8.4" }, "peerDependencies": { @@ -116,9 +116,9 @@ } }, "node_modules/turnstile-types": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/turnstile-types/-/turnstile-types-1.2.2.tgz", - "integrity": "sha512-FlsojSOGe7OxdC5UXVXVyNV3zdWTSaC6tG6cLPWeTSkcBuCzPP+0xUwc1l090ISDcfDEt398GLbXopcGZesY/A==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/turnstile-types/-/turnstile-types-1.2.3.tgz", + "integrity": "sha512-EDjhDB9TDwda2JRbhzO/kButPio3JgrC3gXMVAMotxldybTCJQVMvPNJ89rcAiN9vIrCb2i1E+VNBCqB8wue0A==", "dev": true, "license": "MIT" }, @@ -216,9 +216,9 @@ } }, "turnstile-types": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/turnstile-types/-/turnstile-types-1.2.2.tgz", - "integrity": "sha512-FlsojSOGe7OxdC5UXVXVyNV3zdWTSaC6tG6cLPWeTSkcBuCzPP+0xUwc1l090ISDcfDEt398GLbXopcGZesY/A==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/turnstile-types/-/turnstile-types-1.2.3.tgz", + "integrity": "sha512-EDjhDB9TDwda2JRbhzO/kButPio3JgrC3gXMVAMotxldybTCJQVMvPNJ89rcAiN9vIrCb2i1E+VNBCqB8wue0A==", "dev": true }, "typescript": { diff --git a/package.json b/package.json index 2602322..29206ad 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "devDependencies": { "@types/react": "^18.0.21", "prettier": "^2.7.1", - "turnstile-types": "^1.2.2", + "turnstile-types": "^1.2.3", "typescript": "^4.8.4" } } diff --git a/src/index.tsx b/src/index.tsx index 89daaaa..decbf13 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -144,7 +144,8 @@ export default function Turnstile({ }, "error-callback": (error?: any) => inplaceState.onError?.(error, boundTurnstileObject), - "expired-callback": () => inplaceState.onExpire?.(boundTurnstileObject), + "expired-callback": (token: string) => + inplaceState.onExpire?.(token, boundTurnstileObject), "timeout-callback": () => inplaceState.onTimeout?.(boundTurnstileObject), "after-interactive-callback": () => @@ -201,14 +202,7 @@ export default function Turnstile({ onUnsupported, ]); - return ( -
- ); + return
; } export interface TurnstileProps extends TurnstileCallbacks { @@ -245,7 +239,7 @@ export interface TurnstileCallbacks { error?: Error | any, boundTurnstile?: BoundTurnstileObject ) => void; - onExpire?: (boundTurnstile: BoundTurnstileObject) => void; + onExpire?: (token: string, boundTurnstile: BoundTurnstileObject) => void; onTimeout?: (boundTurnstile: BoundTurnstileObject) => void; onAfterInteractive?: (boundTurnstile: BoundTurnstileObject) => void; onBeforeInteractive?: (boundTurnstile: BoundTurnstileObject) => void;