action_interceptor 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5219caf7c3ae392a580e0a606da9ac737d2e5173
4
- data.tar.gz: 5230304186f4371bdcff05095608eaa64477b286
3
+ metadata.gz: 31e855e9e9869ca8e5d409a7016be38bd81f560a
4
+ data.tar.gz: 5ee08d985554e577b922afd1b5d53db794782794
5
5
  SHA512:
6
- metadata.gz: 55685689e660070c230e0e4026ff4d8221f4199f7793cf60b5501ec59dc112b765834a23c005ca8269f38f5408f94540b1483b3777be626ce3c6f62203483728
7
- data.tar.gz: 5fa8ada75dc889139dfd9a065423dcb3c58614a78c3a9a53aac17ec5c9a03a0abccff0ff45a9a82cc38476f201b9b62ba1962b468cb0ca26693d10b3c2537289
6
+ metadata.gz: 08c253742ec490768f8cac0f082f2692a8b025153a2768c8a2832c64874be5755c1a45ad0542ebc6f7cf226278665131e487d2c714ca3d5043e47bc442c099f2
7
+ data.tar.gz: fe5c9c8635292d2db08b17837f82743d6d14eb645707c702fb26119daf1424a22afaa2e10377f1350f07ac416922ae04465aaf8e82206dd7195a8035708b6029
@@ -28,7 +28,8 @@ module ActionInterceptor
28
28
  key = ActionInterceptor.intercepted_url_key
29
29
 
30
30
  # Can't redirect back to non-get
31
- url = Encryptor.encrypt_and_sign(request.get? ? current_url : root_url)
31
+ # Also, can't call root_url here, so use '/' instead
32
+ url = Encryptor.encrypt_and_sign(request.get? ? current_url : '/')
32
33
  @current_url_hash = {key => url}
33
34
  end
34
35
 
@@ -104,11 +105,17 @@ module ActionInterceptor
104
105
 
105
106
  def without_interceptor_url_options(&block)
106
107
  url_options_with_interceptor = url_options
107
- @interceptor_url_options = url_options_without_interceptor
108
- yield block
109
- @interceptor_url_options = url_options_with_interceptor
108
+
109
+ begin
110
+ @interceptor_url_options = url_options_without_interceptor
111
+ yield block
112
+ ensure
113
+ @interceptor_url_options = url_options_with_interceptor
114
+ end
110
115
  end
111
116
 
117
+ alias_method :without_interceptor, :without_interceptor_url_options
118
+
112
119
  def intercepted_url
113
120
  return @intercepted_url if @intercepted_url
114
121
 
@@ -133,11 +140,14 @@ module ActionInterceptor
133
140
  def redirect_back(options = {})
134
141
  url = intercepted_url
135
142
 
136
- # Convert '/' back to root_url
137
- # Also, prevent self redirects
138
- url = root_url if url == '/' || current_page?(url)
143
+ # Disable the return_to param
144
+ without_interceptor_url_options do
145
+ # Convert '/' back to root_url
146
+ # Also, prevent self redirects
147
+ url = root_url if url == '/' || current_page?(url)
139
148
 
140
- redirect_to url, options
149
+ redirect_to url, options
150
+ end
141
151
  end
142
152
 
143
153
  end
@@ -1,4 +1,4 @@
1
1
  module ActionInterceptor
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_interceptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dante Soares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails