(turnstile: TurnstileInstance)
| 23 | }); |
| 24 | |
| 25 | const readToken = (turnstile: TurnstileInstance): string | undefined => { |
| 26 | try { |
| 27 | return turnstile.getResponse() || undefined; |
| 28 | } catch { |
| 29 | return undefined; |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | // Note: we poll `getResponse()` instead of using `getResponsePromise()`. In |
| 34 | // @marsidev/react-turnstile the latter only waits for the widget to render and |
no outgoing calls
no test coverage detected