Merge pull request #15 from anvyzhang/optimize

Optimize captcha verify
This commit is contained in:
Jason Lee 2015-11-20 10:48:08 +08:00
commit 29d02cc09f
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ module RuCaptcha
def verify_rucaptcha?(resource = nil)
rucaptcha_at = session[:_rucaptcha_at].to_i
# Captcha chars in Session expire in 2 minutes
if rucaptcha_at.blank? || (Time.now.to_i - rucaptcha_at) > 120
if (Time.now.to_i - rucaptcha_at) > 120
return false
end