devise 4.0.0 → 4.0.1
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +7 -11
- data/lib/devise/models/authenticatable.rb +1 -1
- data/lib/devise/models/confirmable.rb +3 -2
- data/lib/devise/models/database_authenticatable.rb +0 -1
- data/lib/devise/version.rb +1 -1
- data/test/models/confirmable_test.rb +13 -5
- data/test/support/mongoid.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79522f86bce86d9799bdcb6423874fa3c97ebe4d
|
4
|
+
data.tar.gz: 345b7fddfccde780d47a4243cca4185e9cc56eb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8034c10fd7ba604728cc7d420a7eafe2f1e403a871aacdded4b3f9dc4517053fe7ddfd342db52735101ae66fabfc84df29f556b2e8152fcd63ba552a3eba5e4e
|
7
|
+
data.tar.gz: 66e6a2fb1cb1f939f11156ea92a0b40c5e90718b2e93a75d7948b700a41093dcabddaf7ef8ff040bb3efd30b4bd46fe0e4e0c3b913bcccd1ca06a5aafb002c23
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
### Unreleased
|
2
2
|
|
3
|
+
### 4.0.1 - 2016-04-25
|
4
|
+
|
5
|
+
* bug fixes
|
6
|
+
* Fix the e-mail confirmation instructions send when a user updates the email
|
7
|
+
address from nil. (by @lmduc)
|
8
|
+
* Remove unnecessary `attribute_will_change!` call. (by @cadejscroggins)
|
9
|
+
* Consistent `permit!` check. (by @ulissesalmeida)
|
10
|
+
|
3
11
|
### 4.0.0 - 2016-04-18
|
4
12
|
|
5
13
|
* bug fixes
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devise (4.0.
|
4
|
+
devise (4.0.1)
|
5
5
|
bcrypt (~> 3.0)
|
6
6
|
orm_adapter (~> 0.1)
|
7
7
|
railties (>= 4.1.0, < 5.1)
|
@@ -48,10 +48,9 @@ GEM
|
|
48
48
|
tzinfo (~> 1.1)
|
49
49
|
arel (6.0.3)
|
50
50
|
bcrypt (3.1.11)
|
51
|
-
bson (
|
51
|
+
bson (4.0.0)
|
52
52
|
builder (3.2.2)
|
53
53
|
concurrent-ruby (1.0.1)
|
54
|
-
connection_pool (2.2.0)
|
55
54
|
erubis (2.7.0)
|
56
55
|
faraday (0.9.2)
|
57
56
|
multipart-post (>= 1.2, < 3)
|
@@ -71,15 +70,13 @@ GEM
|
|
71
70
|
minitest (5.8.4)
|
72
71
|
mocha (1.1.0)
|
73
72
|
metaclass (~> 0.0.1)
|
74
|
-
|
73
|
+
mongo (2.2.0)
|
74
|
+
bson (~> 4.0)
|
75
|
+
mongoid (5.0.1)
|
75
76
|
activemodel (~> 4.0)
|
76
|
-
|
77
|
+
mongo (~> 2.1)
|
77
78
|
origin (~> 2.1)
|
78
79
|
tzinfo (>= 0.3.37)
|
79
|
-
moped (2.0.7)
|
80
|
-
bson (~> 3.0)
|
81
|
-
connection_pool (~> 2.0)
|
82
|
-
optionable (~> 0.2.0)
|
83
80
|
multi_json (1.11.2)
|
84
81
|
multi_xml (0.5.5)
|
85
82
|
multipart-post (2.0.0)
|
@@ -102,7 +99,6 @@ GEM
|
|
102
99
|
omniauth-openid (1.0.1)
|
103
100
|
omniauth (~> 1.0)
|
104
101
|
rack-openid (~> 1.3.1)
|
105
|
-
optionable (0.2.0)
|
106
102
|
origin (2.2.0)
|
107
103
|
orm_adapter (0.5.0)
|
108
104
|
rack (1.6.4)
|
@@ -169,7 +165,7 @@ DEPENDENCIES
|
|
169
165
|
devise!
|
170
166
|
jruby-openssl
|
171
167
|
mocha (~> 1.1)
|
172
|
-
mongoid (~>
|
168
|
+
mongoid (~> 5.0)
|
173
169
|
omniauth (~> 1.3)
|
174
170
|
omniauth-facebook
|
175
171
|
omniauth-oauth2 (~> 1.4)
|
@@ -253,7 +253,7 @@ module Devise
|
|
253
253
|
|
254
254
|
# Find or initialize a record with group of attributes based on a list of required attributes.
|
255
255
|
def find_or_initialize_with_errors(required_attributes, attributes, error=:invalid) #:nodoc:
|
256
|
-
attributes = if attributes.respond_to? :permit
|
256
|
+
attributes = if attributes.respond_to? :permit!
|
257
257
|
attributes.slice(*required_attributes).permit!.to_h.with_indifferent_access
|
258
258
|
else
|
259
259
|
attributes.with_indifferent_access.slice(*required_attributes)
|
@@ -169,6 +169,7 @@ module Devise
|
|
169
169
|
# in models to map to a nice sign up e-mail.
|
170
170
|
def send_on_create_confirmation_instructions
|
171
171
|
send_confirmation_instructions
|
172
|
+
skip_reconfirmation!
|
172
173
|
end
|
173
174
|
|
174
175
|
# Callback to overwrite if confirmation is required or not.
|
@@ -253,13 +254,13 @@ module Devise
|
|
253
254
|
end
|
254
255
|
|
255
256
|
def postpone_email_change?
|
256
|
-
postpone = self.class.reconfirmable && email_changed? &&
|
257
|
+
postpone = self.class.reconfirmable && email_changed? && !@bypass_confirmation_postpone && self.email.present?
|
257
258
|
@bypass_confirmation_postpone = false
|
258
259
|
postpone
|
259
260
|
end
|
260
261
|
|
261
262
|
def reconfirmation_required?
|
262
|
-
self.class.reconfirmable && @reconfirmation_required && self.email.present?
|
263
|
+
self.class.reconfirmable && @reconfirmation_required && (self.email.present? || self.unconfirmed_email.present?)
|
263
264
|
end
|
264
265
|
|
265
266
|
def send_confirmation_notification?
|
@@ -41,7 +41,6 @@ module Devise
|
|
41
41
|
# For legacy reasons, we use `encrypted_password` to store
|
42
42
|
# the hashed password.
|
43
43
|
def password=(new_password)
|
44
|
-
attribute_will_change! 'password'
|
45
44
|
@password = new_password
|
46
45
|
self.encrypted_password = password_digest(@password) if @password.present?
|
47
46
|
end
|
data/lib/devise/version.rb
CHANGED
@@ -114,7 +114,7 @@ class ConfirmableTest < ActiveSupport::TestCase
|
|
114
114
|
|
115
115
|
assert_email_not_sent do
|
116
116
|
user.save!
|
117
|
-
|
117
|
+
assert_not user.confirmed?
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -401,6 +401,14 @@ class ReconfirmableTest < ActiveSupport::TestCase
|
|
401
401
|
assert_match "new_test@example.com", ActionMailer::Base.deliveries.last.body.encoded
|
402
402
|
end
|
403
403
|
|
404
|
+
test 'should send confirmation instructions by email after changing email from nil' do
|
405
|
+
admin = create_admin(email: nil)
|
406
|
+
assert_email_sent "new_test@example.com" do
|
407
|
+
assert admin.update_attributes(email: 'new_test@example.com')
|
408
|
+
end
|
409
|
+
assert_match "new_test@example.com", ActionMailer::Base.deliveries.last.body.encoded
|
410
|
+
end
|
411
|
+
|
404
412
|
test 'should not send confirmation by email after changing password' do
|
405
413
|
admin = create_admin
|
406
414
|
assert admin.confirm
|
@@ -488,8 +496,8 @@ class ReconfirmableTest < ActiveSupport::TestCase
|
|
488
496
|
end
|
489
497
|
|
490
498
|
test 'should not require reconfirmation after creating a record' do
|
491
|
-
|
492
|
-
assert !
|
499
|
+
admin = create_admin
|
500
|
+
assert !admin.pending_reconfirmation?
|
493
501
|
end
|
494
502
|
|
495
503
|
test 'should not require reconfirmation after creating a record with #save called in callback' do
|
@@ -497,7 +505,7 @@ class ReconfirmableTest < ActiveSupport::TestCase
|
|
497
505
|
after_create :save
|
498
506
|
end
|
499
507
|
|
500
|
-
|
501
|
-
assert !
|
508
|
+
admin = Admin::WithSaveInCallback.create(valid_attributes.except(:username))
|
509
|
+
assert !admin.pending_reconfirmation?
|
502
510
|
end
|
503
511
|
end
|
data/test/support/mongoid.yml
CHANGED
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.
|
4
|
+
version: 4.0.1
|
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-04-
|
12
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: warden
|