mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Merge pull request #15586 from pschaub/patch-1
fix: onSuccess prop in Turnstile captcha docs
This commit is contained in:
1 file changed
+3
-3
@@ -165,18 +165,18 @@ Let's create an empty state to store our `captchaToken`
|
||||
const [captchaToken, setCaptchaToken] = useState()
|
||||
```
|
||||
|
||||
Now lets add the Cloudflare Turnstile component to the JSX section of our code
|
||||
Now lets add the Cloudflare Turnstile component to the JSX section of our code:
|
||||
|
||||
```html
|
||||
<Turnstile />
|
||||
```
|
||||
|
||||
We will pass it the sitekey we copied from the Cloudflare website as a property along with a `onVerify` property which takes a callback function. This callback function will have a token as one of its properties. Let's set the token in the state using `setCaptchaToken`
|
||||
We will pass it the sitekey we copied from the Cloudflare website as a property along with a `onSuccess` property which takes a callback function. This callback function will have a token as one of its properties. Let's set the token in the state using `setCaptchaToken`:
|
||||
|
||||
```jsx
|
||||
<Turnstile
|
||||
sitekey="your-sitekey"
|
||||
onVerify={(token) => { setCaptchaToken(token) }
|
||||
onSuccess={(token) => { setCaptchaToken(token) }
|
||||
/>
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user