简体   繁体   English

谷歌验证码过期时间

[英]Google Captcha expiration time

I want to increase expiration time of google captcha but I could not find a solution to handle it.我想增加谷歌验证码的过期时间,但我找不到处理它的解决方案。 I have used the reset method but it's default expiration time(2 minutes) does not let me to control it.我使用了重置方法,但它的默认过期时间(2 分钟)不允许我控制它。

setTimeout(function(){
    grecaptcha.reset();
}, 1200000);

Is there any way to do what I'm looking for?有什么办法可以做我正在寻找的吗?

Set timeout was not good solution for google Captcha.设置超时对于 google Captcha 来说不是一个好的解决方案。 it was better to reset google captcha when session timeout .会话超时时最好重置谷歌验证码。 use the callback function expired-callback使用回调函数 expired-callback

  <script>
       var callback = function() {
          grecaptcha.render('element', {
             'sitekey': 'your-site-key',
             'expired-callback': fnCallback
           });
       };
       var fnCallback = function() {
          grecaptcha.reset();
       };
    </script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM