Use captchas closer to expiring first. #618

This commit is contained in:
ccd0 2015-11-17 21:33:33 -08:00
parent bb32e6eaa5
commit 8f88c58a99
2 changed files with 2 additions and 0 deletions

View File

@ -154,6 +154,7 @@ Captcha.v1 =
challenge: @nodes.img.alt
response: response
timeout: @timeout
@captchas.sort (a, b) -> a.timeout - b.timeout
@count()
@destroy()
@setup false, true

View File

@ -183,6 +183,7 @@ Captcha.v2 =
@captchas.push
response: token or $('textarea', @nodes.container).value
timeout: Date.now() + @lifetime
@captchas.sort (a, b) -> a.timeout - b.timeout
$.set 'captchas', @captchas
@count()