admin管理员组文章数量:1122846
I'm facing a problem with turnstile integration, I need it to be initially rendered on my page not depending on browser I use. Everything works perfectly on chrome browser, but when I try to open login form on safari my turnstile just don't appear on page. Sometimes it loads as expected or when I switch pages, but it takes about 30seconds, but it works only 2 out of 10 tries. Stack is: Next.js + js
I thought there were problems with useEffect or with next-turnstile, but found out that problem is not there, I tried cleaning cookies and browser storage, even opened in incognito, nothing helped to debug the problem.
How I load turnstile initially
useEffect(() => {
function loadTurn(){
if(!useEffectCheck){
setShowTurnstile(false); // Make Turnstile visible again
setTimeout(() => {
setTurnstileStatus("required"); // Reset status and show Turnstile after a delay
setShowTurnstile(true); // Make Turnstile visible again
}, 1000); // Optional delay before showing Turnstile again
}else{
return
}
}
loadTurn()
setUseEffectCheck(true)
}, []);
How my turnstile looks:
<Turnstile
siteKey={process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY}
retry="auto"
refreshExpired="auto"
theme="auto"
key={showTurnstile + "harry"}
onError={() => {
setTurnstileStatus("error");
console.log("Security check failed. Reload the Page.");
}}
onExpire={() => {
setTurnstileStatus("expired");
console.log("Security check expired. Reload the Page.");
}}
onVerify={() => {
setTurnstileStatus("success");
setError(null);
}}
onLoad={() => {
setTurnstileStatus("required");
}}
/>
On safari it looks like that, when it's not loaded:
this how it looks in safari
本文标签: javascriptTurnstile do not show on safariStack Overflow
版权声明:本文标题:javascript - Turnstile do not show on safari - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281794a1926434.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论