-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate hcaptcha vers turnstile (captcha cloudflare)
- Loading branch information
1 parent
08074ac
commit 03e8178
Showing
12 changed files
with
54 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import React, { useEffect, useRef } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const SITE_KEY = '84e24b30-44ca-488c-9260-ec80c290c166'; | ||
const SITE_KEY = '0x4AAAAAAA0pjEgohPDZsyqu'; | ||
|
||
export default function Captcha() { | ||
export default function Captcha({ setWidgetId }) { | ||
const captchaRef = useRef(null); | ||
|
||
useEffect(() => { | ||
if (window.hcaptcha) { | ||
window.hcaptcha.render(captchaRef.current, { | ||
if (window.turnstile) { | ||
window.turnstile.remove(); | ||
const widgetId = window.turnstile.render(captchaRef.current, { | ||
sitekey: SITE_KEY, | ||
}); | ||
setWidgetId(widgetId); | ||
} | ||
}, []); | ||
|
||
return ( | ||
<div ref={captchaRef}></div> | ||
); | ||
} | ||
|
||
Captcha.propTypes = { | ||
setWidgetId: PropTypes.func, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters