cacheable-csrf-token-rails 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/cacheable-csrf-token-rails.rb +2 -3
  2. metadata +9 -10
@@ -9,7 +9,7 @@ module CacheableCSRFTokenRails
9
9
 
10
10
  private
11
11
  def inject_csrf_token
12
- if protect_against_forgery? && token = session['_csrf_token']
12
+ if protect_against_forgery? && token = form_authenticity_token
13
13
  if body_with_token = response.body.gsub!(ApplicationController::TOKEN_PLACEHOLDER, token)
14
14
  response.body = body_with_token
15
15
  end
@@ -22,7 +22,6 @@ module CacheableCSRFTokenRails
22
22
 
23
23
  def token_tag(token=nil)
24
24
  if token != false && protect_against_forgery?
25
- token ||= form_authenticity_token
26
25
  tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => ApplicationController::TOKEN_PLACEHOLDER)
27
26
  else
28
27
  ''
@@ -42,4 +41,4 @@ module CacheableCSRFTokenRails
42
41
  end
43
42
 
44
43
  end # included
45
- end
44
+ end
metadata CHANGED
@@ -1,32 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacheable-csrf-token-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
4
  prerelease:
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Carl Mercier
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-13 00:00:00.000000000 Z
12
+ date: 2013-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
15
+ version_requirements: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.5
20
+ none: false
21
+ name: rails
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
24
+ requirement: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - ! '>='
28
27
  - !ruby/object:Gem::Version
29
28
  version: 3.2.5
29
+ none: false
30
30
  description: CacheableCSRFToken allows you to easily cache Ruby on Rails pages or
31
31
  partials containing a CSRF protection token. The user-specific token will inserted
32
32
  in the HTML before the response is sent to the user.
@@ -45,17 +45,17 @@ rdoc_options: []
45
45
  require_paths:
46
46
  - lib
47
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
- none: false
49
48
  requirements:
50
49
  - - ! '>='
51
50
  - !ruby/object:Gem::Version
52
51
  version: '0'
53
- required_rubygems_version: !ruby/object:Gem::Requirement
54
52
  none: false
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
54
  requirements:
56
55
  - - ! '>='
57
56
  - !ruby/object:Gem::Version
58
57
  version: '0'
58
+ none: false
59
59
  requirements: []
60
60
  rubyforge_project:
61
61
  rubygems_version: 1.8.23
@@ -63,4 +63,3 @@ signing_key:
63
63
  specification_version: 3
64
64
  summary: Cache HTML containing CSRF protection tokens without worrying
65
65
  test_files: []
66
- has_rdoc: