Captchas now last only 5 minutes.

This commit is contained in:
Nicolas Stepien 2012-06-09 02:12:43 +02:00
parent d1cfa987ae
commit 4efe9d2f32
3 changed files with 14 additions and 4 deletions

View File

@ -1834,11 +1834,13 @@
},
load: function() {
var challenge;
this.timeout = Date.now() + 26 * $.MINUTE;
this.timeout = Date.now() + 4 * $.MINUTE;
challenge = this.challenge.firstChild.value;
this.img.alt = challenge;
this.img.src = "//www.google.com/recaptcha/api/image?c=" + challenge;
return this.input.value = null;
this.input.value = null;
clearTimeout(this.timeoutID);
return this.timeoutID = setTimeout(this.reload, 4 * $.MINUTE);
},
count: function(count) {
this.input.placeholder = (function() {

View File

@ -1,4 +1,6 @@
master
- Mayhem
Update captcha longevity to 5 minutes max, as according to 4chan's change.
2.31.5
- Mayhem

View File

@ -1357,12 +1357,18 @@ QR =
@count captchas.length
@reload()
load: ->
# Timeout is available at RecaptchaState.timeout in seconds.
@timeout = Date.now() + 26*$.MINUTE
# Timeout was available at RecaptchaState.timeout in seconds.
# Timeout is now set by moot: 5 minutes.
# We use 5-1 minutes to give upload some time.
@timeout = Date.now() + 4*$.MINUTE
challenge = @challenge.firstChild.value
@img.alt = challenge
@img.src = "//www.google.com/recaptcha/api/image?c=#{challenge}"
@input.value = null
# Refresh captchas every 4 minutes to avoid filling perished ones.
# This used to be done by the recaptcha script, but it doesn't take into account moot's custom value.
clearTimeout @timeoutID
@timeoutID = setTimeout @reload, 4*$.MINUTE
count: (count) ->
@input.placeholder = switch count
when 0