Delete rucapcha after verify (#23)

This commit is contained in:
flypiggy 2016-05-20 10:20:20 +08:00 committed by Jason Lee
parent e5ff2b9e77
commit 3bf67c0994
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ module RuCaptcha
# Captcha chars in Session expire in 2 minutes # Captcha chars in Session expire in 2 minutes
valid = false valid = false
if (Time.now.to_i - rucaptcha_at) <= RuCaptcha.config.expires_in if (Time.now.to_i - rucaptcha_at) <= RuCaptcha.config.expires_in
valid = captcha.present? && captcha == session[:_rucaptcha] valid = captcha.present? && captcha == session.delete(:_rucaptcha)
end end
if resource && resource.respond_to?(:errors) if resource && resource.respond_to?(:errors)