Fix session value expires typo;

Captcha input field disable autocomplete, and set field type as  for shown correct keyboard on mobile view.
version 0.2.5
This commit is contained in:
Jason Lee 2015-11-02 18:09:16 +08:00
parent 2c72ef1ad3
commit 0a0f272d9a
4 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,8 @@
0.2.2 0.2.5
----- -----
- Add `session[:_rucaptcha]` expire time, for protect Rails CookieSession Replay Attack. - Add `session[:_rucaptcha]` expire time, for protect Rails CookieSession Replay Attack.
- Captcha input field disable autocomplete, and set field type as `email` for shown correct keyboard on mobile view.
0.2.3 0.2.3
----- -----

View File

@ -8,7 +8,7 @@ module RuCaptcha
def generate_rucaptcha def generate_rucaptcha
session[:_rucaptcha] = RuCaptcha::Captcha.random_chars session[:_rucaptcha] = RuCaptcha::Captcha.random_chars
session[:rucaptcha_at] = Time.now.to_i session[:_rucaptcha_at] = Time.now.to_i
RuCaptcha::Captcha.create(session[:_rucaptcha]) RuCaptcha::Captcha.create(session[:_rucaptcha])
end end

View File

@ -1,3 +1,3 @@
module RuCaptcha module RuCaptcha
VERSION = '0.2.4' VERSION = '0.2.5'
end end

View File

@ -2,6 +2,8 @@ module RuCaptcha
module ViewHelpers module ViewHelpers
def rucaptcha_input_tag(opts = {}) def rucaptcha_input_tag(opts = {})
opts[:name] = '_rucaptcha' opts[:name] = '_rucaptcha'
opts[:type] = 'email'
opts[:autocomplete] = 'off'
tag(:input, opts) tag(:input, opts)
end end