From 8f88c58a99061699508658f811cb49769509fd6c Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 Nov 2015 21:33:33 -0800 Subject: [PATCH] Use captchas closer to expiring first. #618 --- src/Posting/Captcha.v1.coffee | 1 + src/Posting/Captcha.v2.coffee | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Posting/Captcha.v1.coffee b/src/Posting/Captcha.v1.coffee index ea1fd3ade..9a438d0a0 100644 --- a/src/Posting/Captcha.v1.coffee +++ b/src/Posting/Captcha.v1.coffee @@ -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 diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index ddb7de804..9313f16af 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -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()