devise 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of devise might be problematic. Click here for more details.

@@ -1,3 +1,9 @@
1
+ == 1.0.11
2
+
3
+ * bug fix
4
+ * Make sure xhr requests do not store urls for redirect
5
+ * Squeeze break lines from cookies to avoid duplicated break lines
6
+
1
7
  == 1.0.10
2
8
 
3
9
  * bug fix
@@ -36,7 +36,7 @@ Install warden gem if you don't have it installed:
36
36
 
37
37
  Install devise gem:
38
38
 
39
- gem install devise --version=1.0.9
39
+ gem install devise --version=1.0.10
40
40
 
41
41
  Configure warden and devise gems inside your app:
42
42
 
@@ -64,7 +64,9 @@ module Devise
64
64
  # yet, but we still need to store the uri based on scope, so different scopes
65
65
  # would never use the same uri to redirect.
66
66
  def store_location!(scope)
67
- session[:"#{scope}.return_to"] = request.request_uri if request && request.get?
67
+ if request && request.get? && !request.xhr?
68
+ session[:"#{scope}.return_to"] = request.request_uri
69
+ end
68
70
  end
69
71
  end
70
72
  end
@@ -42,7 +42,10 @@ class Devise::CookieSanitizer
42
42
  def call(env)
43
43
  response = @app.call(env)
44
44
  headers = response[1]
45
- headers[SET_COOKIE] = headers[SET_COOKIE].join("\n") if headers[SET_COOKIE].respond_to?(:join)
45
+ cookies = headers[SET_COOKIE]
46
+ if cookies.respond_to?(:join)
47
+ headers[SET_COOKIE] = cookies.join("\n").squeeze("\n")
48
+ end
46
49
  response
47
50
  end
48
51
  end
@@ -57,4 +60,4 @@ Warden::Manager.after_set_user :event => [:set_user, :authentication] do |record
57
60
  request.reset_session
58
61
  request.session.update(backup)
59
62
  end
60
- end
63
+ end
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "1.0.10".freeze
2
+ VERSION = "1.0.11".freeze
3
3
  end
@@ -190,6 +190,14 @@ class AuthenticationTest < ActionController::IntegrationTest
190
190
  assert_nil session[:"user.return_to"]
191
191
  end
192
192
 
193
+ test 'xml http requests does not store urls for redirect' do
194
+ xhr :get, users_path
195
+ assert_nil session[:"user.return_to"]
196
+
197
+ sign_in_as_user
198
+ assert_template 'home/index'
199
+ end
200
+
193
201
  test 'redirect to configured home path for a given scope after sign in' do
194
202
  sign_in_as_admin
195
203
  assert_equal "/admin_area/home", @request.path
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease: false
4
+ hash: 1
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 10
10
- version: 1.0.10
9
+ - 11
10
+ version: 1.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Jos\xC3\xA9 Valim"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-15 00:00:00 +01:00
19
+ date: 2011-03-11 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  requirements: []
214
214
 
215
215
  rubyforge_project:
216
- rubygems_version: 1.3.7
216
+ rubygems_version: 1.5.3
217
217
  signing_key:
218
218
  specification_version: 3
219
219
  summary: Flexible authentication solution for Rails with Warden