devise 4.0.2 → 4.0.3

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06ed02a023c4f08459f19e001b801464a1caa5aa
4
- data.tar.gz: a391638c22279f189bc36990578b0831d1da2471
3
+ metadata.gz: 71f8722abb5f39d461f25e52897d9805d34c126e
4
+ data.tar.gz: b23ee1e571b673174794685aec473b60ff9cf808
5
5
  SHA512:
6
- metadata.gz: e1ddaa7384069b9bfb29976a4084f70c405ceee6e337951743868de1fd466a633762477b2e74e2d487503a65f2ce009d6b3465c86af7b29033d9f14dedd6ade9
7
- data.tar.gz: e32035cd04f7ef0173842173e3a2be37f060f9e44a9c5bec6b4a1e23b12b738bd8f71c9472061389218ff9a796d604d037c5c6f45b165d9db586f77e82d2d97a
6
+ metadata.gz: 241fcc13d6e66b9ee774be880a5a66d2cf0b0c5af0f440e80b0807b80546c8c41ed00dfbe2e287f2ed5094083d8a9f12218a431fc69f16d08b231e23252f6313
7
+ data.tar.gz: c93cef3ab690017d030726734c6dbbeb5182072594aa908eed750a6374feed0d0f83aa6a28c76312affe6ec30cf6af81da268573e863867133eb67e043398c7a
@@ -1,4 +1,7 @@
1
- ### Unreleased
1
+ ### 4.0.3 - 2016-05-15
2
+
3
+ * bug fixes
4
+ * Fix overwriting the remember_token when a valid one already exists (by @ralinchimev).
2
5
 
3
6
  ### 4.0.2 - 2016-04-25
4
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise (4.0.2)
4
+ devise (4.0.3)
5
5
  bcrypt (~> 3.0)
6
6
  orm_adapter (~> 0.1)
7
7
  railties (>= 4.1.0, < 5.1)
@@ -176,4 +176,4 @@ DEPENDENCIES
176
176
  webrat (= 0.7.3)
177
177
 
178
178
  BUNDLED WITH
179
- 1.11.2
179
+ 1.12.3
@@ -46,7 +46,7 @@ module Devise
46
46
  end
47
47
 
48
48
  def remember_me!
49
- self.remember_token = self.class.remember_token if respond_to?(:remember_token)
49
+ self.remember_token ||= self.class.remember_token if respond_to?(:remember_token)
50
50
  self.remember_created_at ||= Time.now.utc
51
51
  save(validate: false) if self.changed?
52
52
  end
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "4.0.2".freeze
2
+ VERSION = "4.0.3".freeze
3
3
  end
@@ -16,6 +16,18 @@ class RememberableTest < ActiveSupport::TestCase
16
16
  assert user.remember_created_at
17
17
  end
18
18
 
19
+ test 'remember_me should not generate a new token if valid token exists' do
20
+ user = create_user
21
+ user.singleton_class.send(:attr_accessor, :remember_token)
22
+ User.to_adapter.expects(:find_first).returns(nil)
23
+
24
+ user.remember_me!
25
+ existing_token = user.remember_token
26
+
27
+ user.remember_me!
28
+ assert_equal existing_token, user.remember_token
29
+ end
30
+
19
31
  test 'forget_me should not clear remember token if using salt' do
20
32
  user = create_user
21
33
  user.remember_me!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-03 00:00:00.000000000 Z
12
+ date: 2016-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: warden