devise 4.2.1 → 4.3.0
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/.travis.yml +11 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +50 -48
- data/MIT-LICENSE +1 -1
- data/README.md +2 -2
- data/app/controllers/devise/omniauth_callbacks_controller.rb +1 -1
- data/devise.gemspec +1 -1
- data/gemfiles/Gemfile.rails-4.1-stable.lock +3 -3
- data/gemfiles/Gemfile.rails-4.2-stable.lock +6 -5
- data/gemfiles/Gemfile.rails-5.0-stable +34 -0
- data/gemfiles/Gemfile.rails-5.0-stable.lock +193 -0
- data/lib/devise.rb +8 -0
- data/lib/devise/models/confirmable.rb +36 -14
- data/lib/devise/models/database_authenticatable.rb +26 -7
- data/lib/devise/models/recoverable.rb +16 -5
- data/lib/devise/models/validatable.rb +7 -2
- data/lib/devise/version.rb +1 -1
- data/test/integration/rememberable_test.rb +7 -1
- data/test/orm/active_record.rb +1 -1
- data/test/rails_app/app/active_record/user.rb +1 -1
- data/test/rails_app/app/controllers/home_controller.rb +1 -1
- data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +1 -1
- data/test/rails_app/app/controllers/users_controller.rb +3 -3
- data/test/rails_app/config/boot.rb +9 -3
- data/test/rails_app/lib/shared_admin.rb +5 -1
- data/test/routes_test.rb +5 -5
- data/test/test/controller_helpers_test.rb +9 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b580a525adc8af746c4f2f2c22f337f5a605bde
|
4
|
+
data.tar.gz: e39fc8ecd5b3119f79d3f303889d204762d9248c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62ee6bfb4250f0d9af472a00f9ed0937dc9f7526acc97e5012c2c930fb15447f449aa881a1382e73d3b38bb68f7b4410b184c4135959b8c6beb369d35e745fce
|
7
|
+
data.tar.gz: acfb853f1006f573987367481929057a28433fbfab1b731bea10f858fa9343ef85dbb3cdccea3f151389357141a6d2c5425b79419df4ba6926e75161117c90ab
|
data/.travis.yml
CHANGED
@@ -2,13 +2,14 @@ language: ruby
|
|
2
2
|
|
3
3
|
rvm:
|
4
4
|
- 2.1.10
|
5
|
-
- 2.2.
|
6
|
-
- 2.3.
|
7
|
-
- 2.4.
|
5
|
+
- 2.2.7
|
6
|
+
- 2.3.4
|
7
|
+
- 2.4.1
|
8
8
|
- ruby-head
|
9
9
|
|
10
10
|
gemfile:
|
11
11
|
- Gemfile
|
12
|
+
- gemfiles/Gemfile.rails-5.0-stable
|
12
13
|
- gemfiles/Gemfile.rails-4.2-stable
|
13
14
|
- gemfiles/Gemfile.rails-4.1-stable
|
14
15
|
|
@@ -16,12 +17,18 @@ matrix:
|
|
16
17
|
exclude:
|
17
18
|
- rvm: 2.1.10
|
18
19
|
gemfile: Gemfile
|
19
|
-
- rvm: 2.4.
|
20
|
+
- rvm: 2.4.1
|
20
21
|
gemfile: gemfiles/Gemfile.rails-4.1-stable
|
21
22
|
- rvm: ruby-head
|
22
23
|
gemfile: gemfiles/Gemfile.rails-4.1-stable
|
24
|
+
- rvm: 2.1.10
|
25
|
+
gemfile: gemfiles/Gemfile.rails-5.0-stable
|
26
|
+
- rvm: 2.1.10
|
27
|
+
gemfile: Gemfile
|
23
28
|
- env: DEVISE_ORM=mongoid
|
24
29
|
gemfile: Gemfile
|
30
|
+
- env: DEVISE_ORM=mongoid
|
31
|
+
gemfile: gemfiles/Gemfile.rails-5.0-stable
|
25
32
|
allow_failures:
|
26
33
|
- rvm: ruby-head
|
27
34
|
services:
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem "rails", "~> 5.
|
5
|
+
gem "rails", "~> 5.1"
|
6
6
|
gem "omniauth", "~> 1.3"
|
7
7
|
gem "oauth2"
|
8
8
|
gem "omniauth-oauth2"
|
@@ -14,6 +14,9 @@ gem "rails-controller-testing"
|
|
14
14
|
|
15
15
|
gem "responders", "~> 2.1"
|
16
16
|
|
17
|
+
# TODO: Remove this line when Rails 5.1.1 is released
|
18
|
+
gem "minitest", "< 5.10.2"
|
19
|
+
|
17
20
|
group :test do
|
18
21
|
gem "omniauth-facebook"
|
19
22
|
gem "omniauth-openid"
|
data/Gemfile.lock
CHANGED
@@ -10,68 +10,68 @@ GIT
|
|
10
10
|
PATH
|
11
11
|
remote: .
|
12
12
|
specs:
|
13
|
-
devise (4.
|
13
|
+
devise (4.3.0)
|
14
14
|
bcrypt (~> 3.0)
|
15
15
|
orm_adapter (~> 0.1)
|
16
|
-
railties (>= 4.1.0, < 5.
|
16
|
+
railties (>= 4.1.0, < 5.2)
|
17
17
|
responders
|
18
18
|
warden (~> 1.2.3)
|
19
19
|
|
20
20
|
GEM
|
21
21
|
remote: https://rubygems.org/
|
22
22
|
specs:
|
23
|
-
actioncable (5.0
|
24
|
-
actionpack (= 5.0
|
25
|
-
nio4r (
|
23
|
+
actioncable (5.1.0)
|
24
|
+
actionpack (= 5.1.0)
|
25
|
+
nio4r (~> 2.0)
|
26
26
|
websocket-driver (~> 0.6.1)
|
27
|
-
actionmailer (5.0
|
28
|
-
actionpack (= 5.0
|
29
|
-
actionview (= 5.0
|
30
|
-
activejob (= 5.0
|
27
|
+
actionmailer (5.1.0)
|
28
|
+
actionpack (= 5.1.0)
|
29
|
+
actionview (= 5.1.0)
|
30
|
+
activejob (= 5.1.0)
|
31
31
|
mail (~> 2.5, >= 2.5.4)
|
32
32
|
rails-dom-testing (~> 2.0)
|
33
|
-
actionpack (5.0
|
34
|
-
actionview (= 5.0
|
35
|
-
activesupport (= 5.0
|
33
|
+
actionpack (5.1.0)
|
34
|
+
actionview (= 5.1.0)
|
35
|
+
activesupport (= 5.1.0)
|
36
36
|
rack (~> 2.0)
|
37
37
|
rack-test (~> 0.6.3)
|
38
38
|
rails-dom-testing (~> 2.0)
|
39
39
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
40
|
-
actionview (5.0
|
41
|
-
activesupport (= 5.0
|
40
|
+
actionview (5.1.0)
|
41
|
+
activesupport (= 5.1.0)
|
42
42
|
builder (~> 3.1)
|
43
|
-
|
43
|
+
erubi (~> 1.4)
|
44
44
|
rails-dom-testing (~> 2.0)
|
45
45
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
46
|
-
activejob (5.0
|
47
|
-
activesupport (= 5.0
|
46
|
+
activejob (5.1.0)
|
47
|
+
activesupport (= 5.1.0)
|
48
48
|
globalid (>= 0.3.6)
|
49
|
-
activemodel (5.0
|
50
|
-
activesupport (= 5.0
|
51
|
-
activerecord (5.0
|
52
|
-
activemodel (= 5.0
|
53
|
-
activesupport (= 5.0
|
54
|
-
arel (~>
|
55
|
-
activesupport (5.0
|
49
|
+
activemodel (5.1.0)
|
50
|
+
activesupport (= 5.1.0)
|
51
|
+
activerecord (5.1.0)
|
52
|
+
activemodel (= 5.1.0)
|
53
|
+
activesupport (= 5.1.0)
|
54
|
+
arel (~> 8.0)
|
55
|
+
activesupport (5.1.0)
|
56
56
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
57
57
|
i18n (~> 0.7)
|
58
58
|
minitest (~> 5.1)
|
59
59
|
tzinfo (~> 1.1)
|
60
|
-
arel (
|
60
|
+
arel (8.0.0)
|
61
61
|
bcrypt (3.1.11)
|
62
62
|
builder (3.2.3)
|
63
63
|
concurrent-ruby (1.0.5)
|
64
|
-
|
64
|
+
erubi (1.6.0)
|
65
65
|
faraday (0.11.0)
|
66
66
|
multipart-post (>= 1.2, < 3)
|
67
|
-
globalid (0.
|
68
|
-
activesupport (>= 4.
|
67
|
+
globalid (0.4.0)
|
68
|
+
activesupport (>= 4.2.0)
|
69
69
|
hashie (3.5.5)
|
70
70
|
i18n (0.8.1)
|
71
71
|
jwt (1.5.6)
|
72
72
|
loofah (2.0.3)
|
73
73
|
nokogiri (>= 1.5.9)
|
74
|
-
mail (2.6.
|
74
|
+
mail (2.6.5)
|
75
75
|
mime-types (>= 1.16, < 4)
|
76
76
|
metaclass (0.0.4)
|
77
77
|
method_source (0.8.2)
|
@@ -86,7 +86,7 @@ GEM
|
|
86
86
|
multi_xml (0.6.0)
|
87
87
|
multipart-post (2.0.0)
|
88
88
|
nio4r (2.0.0)
|
89
|
-
nokogiri (1.7.
|
89
|
+
nokogiri (1.7.1)
|
90
90
|
mini_portile2 (~> 2.1.0)
|
91
91
|
oauth2 (1.3.1)
|
92
92
|
faraday (>= 0.8, < 0.12)
|
@@ -112,17 +112,17 @@ GEM
|
|
112
112
|
ruby-openid (>= 2.1.8)
|
113
113
|
rack-test (0.6.3)
|
114
114
|
rack (>= 1.0)
|
115
|
-
rails (5.0
|
116
|
-
actioncable (= 5.0
|
117
|
-
actionmailer (= 5.0
|
118
|
-
actionpack (= 5.0
|
119
|
-
actionview (= 5.0
|
120
|
-
activejob (= 5.0
|
121
|
-
activemodel (= 5.0
|
122
|
-
activerecord (= 5.0
|
123
|
-
activesupport (= 5.0
|
115
|
+
rails (5.1.0)
|
116
|
+
actioncable (= 5.1.0)
|
117
|
+
actionmailer (= 5.1.0)
|
118
|
+
actionpack (= 5.1.0)
|
119
|
+
actionview (= 5.1.0)
|
120
|
+
activejob (= 5.1.0)
|
121
|
+
activemodel (= 5.1.0)
|
122
|
+
activerecord (= 5.1.0)
|
123
|
+
activesupport (= 5.1.0)
|
124
124
|
bundler (>= 1.3.0, < 2.0)
|
125
|
-
railties (= 5.0
|
125
|
+
railties (= 5.1.0)
|
126
126
|
sprockets-rails (>= 2.0.0)
|
127
127
|
rails-controller-testing (1.0.1)
|
128
128
|
actionpack (~> 5.x)
|
@@ -133,16 +133,17 @@ GEM
|
|
133
133
|
nokogiri (~> 1.6)
|
134
134
|
rails-html-sanitizer (1.0.3)
|
135
135
|
loofah (~> 2.0)
|
136
|
-
railties (5.0
|
137
|
-
actionpack (= 5.0
|
138
|
-
activesupport (= 5.0
|
136
|
+
railties (5.1.0)
|
137
|
+
actionpack (= 5.1.0)
|
138
|
+
activesupport (= 5.1.0)
|
139
139
|
method_source
|
140
140
|
rake (>= 0.8.7)
|
141
141
|
thor (>= 0.18.1, < 2.0)
|
142
142
|
rake (12.0.0)
|
143
143
|
rdoc (5.1.0)
|
144
|
-
responders (2.
|
145
|
-
|
144
|
+
responders (2.4.0)
|
145
|
+
actionpack (>= 4.2.0, < 5.3)
|
146
|
+
railties (>= 4.2.0, < 5.3)
|
146
147
|
ruby-openid (2.7.0)
|
147
148
|
sprockets (3.7.1)
|
148
149
|
concurrent-ruby (~> 1.0)
|
@@ -154,7 +155,7 @@ GEM
|
|
154
155
|
sqlite3 (1.3.13)
|
155
156
|
thor (0.19.4)
|
156
157
|
thread_safe (0.3.6)
|
157
|
-
tzinfo (1.2.
|
158
|
+
tzinfo (1.2.3)
|
158
159
|
thread_safe (~> 0.1)
|
159
160
|
warden (1.2.7)
|
160
161
|
rack (>= 1.0)
|
@@ -175,13 +176,14 @@ DEPENDENCIES
|
|
175
176
|
activerecord-jdbcsqlite3-adapter
|
176
177
|
devise!
|
177
178
|
jruby-openssl
|
179
|
+
minitest (< 5.10.2)
|
178
180
|
mocha (~> 1.1)
|
179
181
|
oauth2
|
180
182
|
omniauth (~> 1.3)
|
181
183
|
omniauth-facebook
|
182
184
|
omniauth-oauth2
|
183
185
|
omniauth-openid
|
184
|
-
rails (~> 5.
|
186
|
+
rails (~> 5.1)
|
185
187
|
rails-controller-testing
|
186
188
|
rdoc
|
187
189
|
responders (~> 2.1)
|
@@ -189,4 +191,4 @@ DEPENDENCIES
|
|
189
191
|
webrat (= 0.7.3)
|
190
192
|
|
191
193
|
BUNDLED WITH
|
192
|
-
1.
|
194
|
+
1.14.6
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -124,7 +124,7 @@ $ rails generate devise MODEL
|
|
124
124
|
|
125
125
|
Next, check the MODEL for any additional configuration options you might want to add, such as confirmable or lockable. If you add an option, be sure to inspect the migration file (created by the generator if your ORM supports them) and uncomment the appropriate section. For example, if you add the confirmable option in the model, you'll need to uncomment the Confirmable section in the migration.
|
126
126
|
|
127
|
-
Then run `
|
127
|
+
Then run `rails db:migrate`
|
128
128
|
|
129
129
|
You should restart your application after changing Devise's configuration options. Otherwise, you will run into strange errors, for example, users being unable to login and route helpers being undefined.
|
130
130
|
|
@@ -610,6 +610,6 @@ https://github.com/plataformatec/devise/graphs/contributors
|
|
610
610
|
|
611
611
|
## License
|
612
612
|
|
613
|
-
MIT License. Copyright 2009-
|
613
|
+
MIT License. Copyright 2009-2017 Plataformatec. http://plataformatec.com.br
|
614
614
|
|
615
615
|
You are not granted rights or licenses to the trademarks of Plataformatec, including without limitation the Devise name or logo.
|
@@ -2,7 +2,7 @@ class Devise::OmniauthCallbacksController < DeviseController
|
|
2
2
|
prepend_before_action { request.env["devise.skip_timeout"] = true }
|
3
3
|
|
4
4
|
def passthru
|
5
|
-
render status: 404,
|
5
|
+
render status: 404, plain: "Not found. Authentication passthru."
|
6
6
|
end
|
7
7
|
|
8
8
|
def failure
|
data/devise.gemspec
CHANGED
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency("warden", "~> 1.2.3")
|
22
22
|
s.add_dependency("orm_adapter", "~> 0.1")
|
23
23
|
s.add_dependency("bcrypt", "~> 3.0")
|
24
|
-
s.add_dependency("railties", ">= 4.1.0", "< 5.
|
24
|
+
s.add_dependency("railties", ">= 4.1.0", "< 5.2")
|
25
25
|
s.add_dependency("responders")
|
26
26
|
end
|
@@ -21,10 +21,10 @@ GIT
|
|
21
21
|
PATH
|
22
22
|
remote: ..
|
23
23
|
specs:
|
24
|
-
devise (4.
|
24
|
+
devise (4.3.0)
|
25
25
|
bcrypt (~> 3.0)
|
26
26
|
orm_adapter (~> 0.1)
|
27
|
-
railties (>= 4.1.0, < 5.
|
27
|
+
railties (>= 4.1.0, < 5.2)
|
28
28
|
responders
|
29
29
|
warden (~> 1.2.3)
|
30
30
|
|
@@ -168,4 +168,4 @@ DEPENDENCIES
|
|
168
168
|
webrat (= 0.7.3)
|
169
169
|
|
170
170
|
BUNDLED WITH
|
171
|
-
1.
|
171
|
+
1.14.6
|
@@ -57,10 +57,10 @@ GIT
|
|
57
57
|
PATH
|
58
58
|
remote: ..
|
59
59
|
specs:
|
60
|
-
devise (4.
|
60
|
+
devise (4.3.0)
|
61
61
|
bcrypt (~> 3.0)
|
62
62
|
orm_adapter (~> 0.1)
|
63
|
-
railties (>= 4.1.0, < 5.
|
63
|
+
railties (>= 4.1.0, < 5.2)
|
64
64
|
responders
|
65
65
|
warden (~> 1.2.3)
|
66
66
|
|
@@ -143,8 +143,9 @@ GEM
|
|
143
143
|
loofah (~> 2.0)
|
144
144
|
rake (12.0.0)
|
145
145
|
rdoc (5.1.0)
|
146
|
-
responders (2.
|
147
|
-
|
146
|
+
responders (2.4.0)
|
147
|
+
actionpack (>= 4.2.0, < 5.3)
|
148
|
+
railties (>= 4.2.0, < 5.3)
|
148
149
|
ruby-openid (2.7.0)
|
149
150
|
sprockets (3.7.1)
|
150
151
|
concurrent-ruby (~> 1.0)
|
@@ -188,4 +189,4 @@ DEPENDENCIES
|
|
188
189
|
webrat (= 0.7.3)
|
189
190
|
|
190
191
|
BUNDLED WITH
|
191
|
-
1.
|
192
|
+
1.14.6
|
@@ -0,0 +1,34 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec path: ".."
|
4
|
+
|
5
|
+
gem "rails", '~> 5.0.0'
|
6
|
+
gem "omniauth"
|
7
|
+
gem "omniauth-oauth2"
|
8
|
+
gem "rdoc"
|
9
|
+
|
10
|
+
gem "activemodel-serializers-xml", github: "rails/activemodel-serializers-xml"
|
11
|
+
|
12
|
+
gem "rails-controller-testing"
|
13
|
+
|
14
|
+
gem "responders", "~> 2.1"
|
15
|
+
|
16
|
+
# TODO: Remove this line when Rails 5.0.3 is released
|
17
|
+
gem "minitest", "< 5.10.2"
|
18
|
+
|
19
|
+
group :test do
|
20
|
+
gem "omniauth-facebook"
|
21
|
+
gem "omniauth-openid"
|
22
|
+
gem "webrat", "0.7.3", require: false
|
23
|
+
gem "mocha", "~> 1.1", require: false
|
24
|
+
gem 'test_after_commit', require: false
|
25
|
+
end
|
26
|
+
|
27
|
+
platforms :ruby do
|
28
|
+
gem "sqlite3"
|
29
|
+
end
|
30
|
+
|
31
|
+
# TODO:
|
32
|
+
# group :mongoid do
|
33
|
+
# gem "mongoid", "~> 4.0.0"
|
34
|
+
# end
|
@@ -0,0 +1,193 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/rails/activemodel-serializers-xml.git
|
3
|
+
revision: dd9c0acf26aab111ebc647cd8deb99ebc6946531
|
4
|
+
specs:
|
5
|
+
activemodel-serializers-xml (1.0.1)
|
6
|
+
activemodel (> 5.x)
|
7
|
+
activesupport (> 5.x)
|
8
|
+
builder (~> 3.1)
|
9
|
+
|
10
|
+
PATH
|
11
|
+
remote: ..
|
12
|
+
specs:
|
13
|
+
devise (4.3.0)
|
14
|
+
bcrypt (~> 3.0)
|
15
|
+
orm_adapter (~> 0.1)
|
16
|
+
railties (>= 4.1.0, < 5.2)
|
17
|
+
responders
|
18
|
+
warden (~> 1.2.3)
|
19
|
+
|
20
|
+
GEM
|
21
|
+
remote: https://rubygems.org/
|
22
|
+
specs:
|
23
|
+
actioncable (5.0.2)
|
24
|
+
actionpack (= 5.0.2)
|
25
|
+
nio4r (>= 1.2, < 3.0)
|
26
|
+
websocket-driver (~> 0.6.1)
|
27
|
+
actionmailer (5.0.2)
|
28
|
+
actionpack (= 5.0.2)
|
29
|
+
actionview (= 5.0.2)
|
30
|
+
activejob (= 5.0.2)
|
31
|
+
mail (~> 2.5, >= 2.5.4)
|
32
|
+
rails-dom-testing (~> 2.0)
|
33
|
+
actionpack (5.0.2)
|
34
|
+
actionview (= 5.0.2)
|
35
|
+
activesupport (= 5.0.2)
|
36
|
+
rack (~> 2.0)
|
37
|
+
rack-test (~> 0.6.3)
|
38
|
+
rails-dom-testing (~> 2.0)
|
39
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
40
|
+
actionview (5.0.2)
|
41
|
+
activesupport (= 5.0.2)
|
42
|
+
builder (~> 3.1)
|
43
|
+
erubis (~> 2.7.0)
|
44
|
+
rails-dom-testing (~> 2.0)
|
45
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
46
|
+
activejob (5.0.2)
|
47
|
+
activesupport (= 5.0.2)
|
48
|
+
globalid (>= 0.3.6)
|
49
|
+
activemodel (5.0.2)
|
50
|
+
activesupport (= 5.0.2)
|
51
|
+
activerecord (5.0.2)
|
52
|
+
activemodel (= 5.0.2)
|
53
|
+
activesupport (= 5.0.2)
|
54
|
+
arel (~> 7.0)
|
55
|
+
activesupport (5.0.2)
|
56
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
57
|
+
i18n (~> 0.7)
|
58
|
+
minitest (~> 5.1)
|
59
|
+
tzinfo (~> 1.1)
|
60
|
+
arel (7.1.4)
|
61
|
+
bcrypt (3.1.11)
|
62
|
+
builder (3.2.3)
|
63
|
+
concurrent-ruby (1.0.5)
|
64
|
+
erubis (2.7.0)
|
65
|
+
faraday (0.11.0)
|
66
|
+
multipart-post (>= 1.2, < 3)
|
67
|
+
globalid (0.4.0)
|
68
|
+
activesupport (>= 4.2.0)
|
69
|
+
hashie (3.5.5)
|
70
|
+
i18n (0.8.1)
|
71
|
+
jwt (1.5.6)
|
72
|
+
loofah (2.0.3)
|
73
|
+
nokogiri (>= 1.5.9)
|
74
|
+
mail (2.6.5)
|
75
|
+
mime-types (>= 1.16, < 4)
|
76
|
+
metaclass (0.0.4)
|
77
|
+
method_source (0.8.2)
|
78
|
+
mime-types (3.1)
|
79
|
+
mime-types-data (~> 3.2015)
|
80
|
+
mime-types-data (3.2016.0521)
|
81
|
+
mini_portile2 (2.1.0)
|
82
|
+
minitest (5.10.1)
|
83
|
+
mocha (1.2.1)
|
84
|
+
metaclass (~> 0.0.1)
|
85
|
+
multi_json (1.12.1)
|
86
|
+
multi_xml (0.6.0)
|
87
|
+
multipart-post (2.0.0)
|
88
|
+
nio4r (2.0.0)
|
89
|
+
nokogiri (1.7.2)
|
90
|
+
mini_portile2 (~> 2.1.0)
|
91
|
+
oauth2 (1.3.1)
|
92
|
+
faraday (>= 0.8, < 0.12)
|
93
|
+
jwt (~> 1.0)
|
94
|
+
multi_json (~> 1.3)
|
95
|
+
multi_xml (~> 0.5)
|
96
|
+
rack (>= 1.2, < 3)
|
97
|
+
omniauth (1.6.1)
|
98
|
+
hashie (>= 3.4.6, < 3.6.0)
|
99
|
+
rack (>= 1.6.2, < 3)
|
100
|
+
omniauth-facebook (4.0.0)
|
101
|
+
omniauth-oauth2 (~> 1.2)
|
102
|
+
omniauth-oauth2 (1.4.0)
|
103
|
+
oauth2 (~> 1.0)
|
104
|
+
omniauth (~> 1.2)
|
105
|
+
omniauth-openid (1.0.1)
|
106
|
+
omniauth (~> 1.0)
|
107
|
+
rack-openid (~> 1.3.1)
|
108
|
+
orm_adapter (0.5.0)
|
109
|
+
rack (2.0.2)
|
110
|
+
rack-openid (1.3.1)
|
111
|
+
rack (>= 1.1.0)
|
112
|
+
ruby-openid (>= 2.1.8)
|
113
|
+
rack-test (0.6.3)
|
114
|
+
rack (>= 1.0)
|
115
|
+
rails (5.0.2)
|
116
|
+
actioncable (= 5.0.2)
|
117
|
+
actionmailer (= 5.0.2)
|
118
|
+
actionpack (= 5.0.2)
|
119
|
+
actionview (= 5.0.2)
|
120
|
+
activejob (= 5.0.2)
|
121
|
+
activemodel (= 5.0.2)
|
122
|
+
activerecord (= 5.0.2)
|
123
|
+
activesupport (= 5.0.2)
|
124
|
+
bundler (>= 1.3.0, < 2.0)
|
125
|
+
railties (= 5.0.2)
|
126
|
+
sprockets-rails (>= 2.0.0)
|
127
|
+
rails-controller-testing (1.0.1)
|
128
|
+
actionpack (~> 5.x)
|
129
|
+
actionview (~> 5.x)
|
130
|
+
activesupport (~> 5.x)
|
131
|
+
rails-dom-testing (2.0.3)
|
132
|
+
activesupport (>= 4.2.0)
|
133
|
+
nokogiri (>= 1.6)
|
134
|
+
rails-html-sanitizer (1.0.3)
|
135
|
+
loofah (~> 2.0)
|
136
|
+
railties (5.0.2)
|
137
|
+
actionpack (= 5.0.2)
|
138
|
+
activesupport (= 5.0.2)
|
139
|
+
method_source
|
140
|
+
rake (>= 0.8.7)
|
141
|
+
thor (>= 0.18.1, < 2.0)
|
142
|
+
rake (12.0.0)
|
143
|
+
rdoc (5.1.0)
|
144
|
+
responders (2.4.0)
|
145
|
+
actionpack (>= 4.2.0, < 5.3)
|
146
|
+
railties (>= 4.2.0, < 5.3)
|
147
|
+
ruby-openid (2.7.0)
|
148
|
+
sprockets (3.7.1)
|
149
|
+
concurrent-ruby (~> 1.0)
|
150
|
+
rack (> 1, < 3)
|
151
|
+
sprockets-rails (3.2.0)
|
152
|
+
actionpack (>= 4.0)
|
153
|
+
activesupport (>= 4.0)
|
154
|
+
sprockets (>= 3.0.0)
|
155
|
+
sqlite3 (1.3.13)
|
156
|
+
test_after_commit (1.1.0)
|
157
|
+
activerecord (>= 3.2)
|
158
|
+
thor (0.19.4)
|
159
|
+
thread_safe (0.3.6)
|
160
|
+
tzinfo (1.2.3)
|
161
|
+
thread_safe (~> 0.1)
|
162
|
+
warden (1.2.7)
|
163
|
+
rack (>= 1.0)
|
164
|
+
webrat (0.7.3)
|
165
|
+
nokogiri (>= 1.2.0)
|
166
|
+
rack (>= 1.0)
|
167
|
+
rack-test (>= 0.5.3)
|
168
|
+
websocket-driver (0.6.5)
|
169
|
+
websocket-extensions (>= 0.1.0)
|
170
|
+
websocket-extensions (0.1.2)
|
171
|
+
|
172
|
+
PLATFORMS
|
173
|
+
ruby
|
174
|
+
|
175
|
+
DEPENDENCIES
|
176
|
+
activemodel-serializers-xml!
|
177
|
+
devise!
|
178
|
+
minitest (< 5.10.2)
|
179
|
+
mocha (~> 1.1)
|
180
|
+
omniauth
|
181
|
+
omniauth-facebook
|
182
|
+
omniauth-oauth2
|
183
|
+
omniauth-openid
|
184
|
+
rails (~> 5.0.0)
|
185
|
+
rails-controller-testing
|
186
|
+
rdoc
|
187
|
+
responders (~> 2.1)
|
188
|
+
sqlite3
|
189
|
+
test_after_commit
|
190
|
+
webrat (= 0.7.3)
|
191
|
+
|
192
|
+
BUNDLED WITH
|
193
|
+
1.14.6
|
data/lib/devise.rb
CHANGED
@@ -290,6 +290,14 @@ module Devise
|
|
290
290
|
mattr_accessor :token_generator
|
291
291
|
@@token_generator = nil
|
292
292
|
|
293
|
+
def self.rails51? # :nodoc:
|
294
|
+
Rails.gem_version >= Gem::Version.new("5.1.x")
|
295
|
+
end
|
296
|
+
|
297
|
+
def self.activerecord51? # :nodoc:
|
298
|
+
defined?(ActiveRecord) && ActiveRecord.gem_version >= Gem::Version.new("5.1.x")
|
299
|
+
end
|
300
|
+
|
293
301
|
# Default way to set up Devise. Run rails generate devise_install to create
|
294
302
|
# a fresh initializer with all configuration values.
|
295
303
|
def self.setup
|
@@ -253,22 +253,44 @@ module Devise
|
|
253
253
|
generate_confirmation_token && save(validate: false)
|
254
254
|
end
|
255
255
|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
256
|
+
if Devise.activerecord51?
|
257
|
+
def postpone_email_change_until_confirmation_and_regenerate_confirmation_token
|
258
|
+
@reconfirmation_required = true
|
259
|
+
self.unconfirmed_email = self.email
|
260
|
+
self.email = self.email_in_database
|
261
|
+
self.confirmation_token = nil
|
262
|
+
generate_confirmation_token
|
263
|
+
end
|
264
|
+
else
|
265
|
+
def postpone_email_change_until_confirmation_and_regenerate_confirmation_token
|
266
|
+
@reconfirmation_required = true
|
267
|
+
self.unconfirmed_email = self.email
|
268
|
+
self.email = self.email_was
|
269
|
+
self.confirmation_token = nil
|
270
|
+
generate_confirmation_token
|
271
|
+
end
|
262
272
|
end
|
263
273
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
274
|
+
if Devise.activerecord51?
|
275
|
+
def postpone_email_change?
|
276
|
+
postpone = self.class.reconfirmable &&
|
277
|
+
will_save_change_to_email? &&
|
278
|
+
!@bypass_confirmation_postpone &&
|
279
|
+
self.email.present? &&
|
280
|
+
(!@skip_reconfirmation_in_callback || !self.email_in_database.nil?)
|
281
|
+
@bypass_confirmation_postpone = false
|
282
|
+
postpone
|
283
|
+
end
|
284
|
+
else
|
285
|
+
def postpone_email_change?
|
286
|
+
postpone = self.class.reconfirmable &&
|
287
|
+
email_changed? &&
|
288
|
+
!@bypass_confirmation_postpone &&
|
289
|
+
self.email.present? &&
|
290
|
+
(!@skip_reconfirmation_in_callback || !self.email_was.nil?)
|
291
|
+
@bypass_confirmation_postpone = false
|
292
|
+
postpone
|
293
|
+
end
|
272
294
|
end
|
273
295
|
|
274
296
|
def reconfirmation_required?
|
@@ -137,9 +137,16 @@ module Devise
|
|
137
137
|
encrypted_password[0,29] if encrypted_password
|
138
138
|
end
|
139
139
|
|
140
|
-
|
141
|
-
|
142
|
-
|
140
|
+
if Devise.activerecord51?
|
141
|
+
# Send notification to user when email changes.
|
142
|
+
def send_email_changed_notification
|
143
|
+
send_devise_notification(:email_changed, to: email_before_last_save)
|
144
|
+
end
|
145
|
+
else
|
146
|
+
# Send notification to user when email changes.
|
147
|
+
def send_email_changed_notification
|
148
|
+
send_devise_notification(:email_changed, to: email_was)
|
149
|
+
end
|
143
150
|
end
|
144
151
|
|
145
152
|
# Send notification to user when password changes.
|
@@ -158,12 +165,24 @@ module Devise
|
|
158
165
|
Devise::Encryptor.digest(self.class, password)
|
159
166
|
end
|
160
167
|
|
161
|
-
|
162
|
-
|
168
|
+
if Devise.activerecord51?
|
169
|
+
def send_email_changed_notification?
|
170
|
+
self.class.send_email_changed_notification && saved_change_to_email?
|
171
|
+
end
|
172
|
+
else
|
173
|
+
def send_email_changed_notification?
|
174
|
+
self.class.send_email_changed_notification && email_changed?
|
175
|
+
end
|
163
176
|
end
|
164
177
|
|
165
|
-
|
166
|
-
|
178
|
+
if Devise.activerecord51?
|
179
|
+
def send_password_change_notification?
|
180
|
+
self.class.send_password_change_notification && saved_change_to_encrypted_password?
|
181
|
+
end
|
182
|
+
else
|
183
|
+
def send_password_change_notification?
|
184
|
+
self.class.send_password_change_notification && encrypted_password_changed?
|
185
|
+
end
|
167
186
|
end
|
168
187
|
|
169
188
|
module ClassMethods
|
@@ -97,13 +97,24 @@ module Devise
|
|
97
97
|
send_devise_notification(:reset_password_instructions, token, {})
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
100
|
+
if Devise.activerecord51?
|
101
|
+
def clear_reset_password_token?
|
102
|
+
encrypted_password_changed = respond_to?(:will_save_change_to_encrypted_password?) && will_save_change_to_encrypted_password?
|
103
|
+
authentication_keys_changed = self.class.authentication_keys.any? do |attribute|
|
104
|
+
respond_to?("will_save_change_to_#{attribute}?") && send("will_save_change_to_#{attribute}?")
|
105
|
+
end
|
106
|
+
|
107
|
+
authentication_keys_changed || encrypted_password_changed
|
104
108
|
end
|
109
|
+
else
|
110
|
+
def clear_reset_password_token?
|
111
|
+
encrypted_password_changed = respond_to?(:encrypted_password_changed?) && encrypted_password_changed?
|
112
|
+
authentication_keys_changed = self.class.authentication_keys.any? do |attribute|
|
113
|
+
respond_to?("#{attribute}_changed?") && send("#{attribute}_changed?")
|
114
|
+
end
|
105
115
|
|
106
|
-
|
116
|
+
authentication_keys_changed || encrypted_password_changed
|
117
|
+
end
|
107
118
|
end
|
108
119
|
|
109
120
|
module ClassMethods
|
@@ -27,8 +27,13 @@ module Devise
|
|
27
27
|
|
28
28
|
base.class_eval do
|
29
29
|
validates_presence_of :email, if: :email_required?
|
30
|
-
|
31
|
-
|
30
|
+
if Devise.activerecord51?
|
31
|
+
validates_uniqueness_of :email, allow_blank: true, if: :will_save_change_to_email?
|
32
|
+
validates_format_of :email, with: email_regexp, allow_blank: true, if: :will_save_change_to_email?
|
33
|
+
else
|
34
|
+
validates_uniqueness_of :email, allow_blank: true, if: :email_changed?
|
35
|
+
validates_format_of :email, with: email_regexp, allow_blank: true, if: :email_changed?
|
36
|
+
end
|
32
37
|
|
33
38
|
validates_presence_of :password, if: :password_required?
|
34
39
|
validates_confirmation_of :password, if: :password_required?
|
data/lib/devise/version.rb
CHANGED
@@ -10,7 +10,13 @@ class RememberMeTest < Devise::IntegrationTest
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def generate_signed_cookie(raw_cookie)
|
13
|
-
request = Devise.
|
13
|
+
request = if Devise::Test.rails51?
|
14
|
+
ActionController::TestRequest.create(Class.new) # needs a "controller class"
|
15
|
+
elsif Devise::Test.rails5?
|
16
|
+
ActionController::TestRequest.create
|
17
|
+
else
|
18
|
+
ActionController::TestRequest.new
|
19
|
+
end
|
14
20
|
request.cookie_jar.signed['raw_cookie'] = raw_cookie
|
15
21
|
request.cookie_jar['raw_cookie']
|
16
22
|
end
|
data/test/orm/active_record.rb
CHANGED
@@ -5,7 +5,7 @@ ActiveRecord::Base.include_root_in_json = true
|
|
5
5
|
ActiveRecord::Migrator.migrate(File.expand_path("../../rails_app/db/migrate/", __FILE__))
|
6
6
|
|
7
7
|
class ActiveSupport::TestCase
|
8
|
-
if Devise.rails5?
|
8
|
+
if Devise::Test.rails5?
|
9
9
|
self.use_transactional_tests = true
|
10
10
|
else
|
11
11
|
# Let `after_commit` work with transactional fixtures, however this is not needed for Rails 5.
|
@@ -9,6 +9,6 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|
9
9
|
user = User.to_adapter.find_first(email: 'user@test.com')
|
10
10
|
user.remember_me = true
|
11
11
|
sign_in user
|
12
|
-
render (Devise.rails5? ? :body : :text) => ""
|
12
|
+
render (Devise::Test.rails5? ? :body : :text) => ""
|
13
13
|
end
|
14
14
|
end
|
@@ -13,7 +13,7 @@ class UsersController < ApplicationController
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def update_form
|
16
|
-
render (Devise.rails5? ? :body : :text) => 'Update'
|
16
|
+
render (Devise::Test.rails5? ? :body : :text) => 'Update'
|
17
17
|
end
|
18
18
|
|
19
19
|
def accept
|
@@ -21,11 +21,11 @@ class UsersController < ApplicationController
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def exhibit
|
24
|
-
render (Devise.rails5? ? :body : :text) => current_user ? "User is authenticated" : "User is not authenticated"
|
24
|
+
render (Devise::Test.rails5? ? :body : :text) => current_user ? "User is authenticated" : "User is not authenticated"
|
25
25
|
end
|
26
26
|
|
27
27
|
def expire
|
28
28
|
user_session['last_request_at'] = 31.minutes.ago.utc
|
29
|
-
render (Devise.rails5? ? :body : :text) => 'User will be expired on next request'
|
29
|
+
render (Devise::Test.rails5? ? :body : :text) => 'User will be expired on next request'
|
30
30
|
end
|
31
31
|
end
|
@@ -3,9 +3,15 @@ unless defined?(DEVISE_ORM)
|
|
3
3
|
end
|
4
4
|
|
5
5
|
module Devise
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
module Test
|
7
|
+
# Detection for minor differences between Rails 4 and 5, and 5.1 in tests.
|
8
|
+
def self.rails51?
|
9
|
+
Rails.version.start_with? '5.1'
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.rails5?
|
13
|
+
Rails.version.start_with? '5'
|
14
|
+
end
|
9
15
|
end
|
10
16
|
end
|
11
17
|
|
@@ -8,7 +8,11 @@ module SharedAdmin
|
|
8
8
|
allow_unconfirmed_access_for: 2.weeks, reconfirmable: true
|
9
9
|
|
10
10
|
validates_length_of :reset_password_token, minimum: 3, allow_blank: true
|
11
|
-
|
11
|
+
if Devise::Test.rails51?
|
12
|
+
validates_uniqueness_of :email, allow_blank: true, if: :will_save_change_to_email?
|
13
|
+
else
|
14
|
+
validates_uniqueness_of :email, allow_blank: true, if: :email_changed?
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
def raw_confirmation_token
|
data/test/routes_test.rb
CHANGED
@@ -203,7 +203,7 @@ class CustomizedRoutingTest < ActionController::TestCase
|
|
203
203
|
|
204
204
|
test 'map with format false for sessions' do
|
205
205
|
expected_params = {controller: 'devise/sessions', action: 'new'}
|
206
|
-
expected_params[:format] = false if Devise.rails5?
|
206
|
+
expected_params[:format] = false if Devise::Test.rails5?
|
207
207
|
|
208
208
|
assert_recognizes(expected_params, {path: '/htmlonly_admin/sign_in', method: :get})
|
209
209
|
assert_raise ExpectedRoutingError do
|
@@ -213,7 +213,7 @@ class CustomizedRoutingTest < ActionController::TestCase
|
|
213
213
|
|
214
214
|
test 'map with format false for passwords' do
|
215
215
|
expected_params = {controller: 'devise/passwords', action: 'create'}
|
216
|
-
expected_params[:format] = false if Devise.rails5?
|
216
|
+
expected_params[:format] = false if Devise::Test.rails5?
|
217
217
|
|
218
218
|
assert_recognizes(expected_params, {path: '/htmlonly_admin/password', method: :post})
|
219
219
|
assert_raise ExpectedRoutingError do
|
@@ -223,7 +223,7 @@ class CustomizedRoutingTest < ActionController::TestCase
|
|
223
223
|
|
224
224
|
test 'map with format false for registrations' do
|
225
225
|
expected_params = {controller: 'devise/registrations', action: 'new'}
|
226
|
-
expected_params[:format] = false if Devise.rails5?
|
226
|
+
expected_params[:format] = false if Devise::Test.rails5?
|
227
227
|
|
228
228
|
assert_recognizes(expected_params, {path: '/htmlonly_admin/sign_up', method: :get})
|
229
229
|
assert_raise ExpectedRoutingError do
|
@@ -233,7 +233,7 @@ class CustomizedRoutingTest < ActionController::TestCase
|
|
233
233
|
|
234
234
|
test 'map with format false for confirmations' do
|
235
235
|
expected_params = {controller: 'devise/confirmations', action: 'show'}
|
236
|
-
expected_params[:format] = false if Devise.rails5?
|
236
|
+
expected_params[:format] = false if Devise::Test.rails5?
|
237
237
|
|
238
238
|
assert_recognizes(expected_params, {path: '/htmlonly_users/confirmation', method: :get})
|
239
239
|
assert_raise ExpectedRoutingError do
|
@@ -243,7 +243,7 @@ class CustomizedRoutingTest < ActionController::TestCase
|
|
243
243
|
|
244
244
|
test 'map with format false for unlocks' do
|
245
245
|
expected_params = {controller: 'devise/unlocks', action: 'show'}
|
246
|
-
expected_params[:format] = false if Devise.rails5?
|
246
|
+
expected_params[:format] = false if Devise::Test.rails5?
|
247
247
|
|
248
248
|
assert_recognizes(expected_params, {path: '/htmlonly_users/unlock', method: :get})
|
249
249
|
assert_raise ExpectedRoutingError do
|
@@ -163,7 +163,15 @@ class TestControllerHelpersTest < Devise::ControllerTestCase
|
|
163
163
|
|
164
164
|
test "creates a new warden proxy if the request object has changed" do
|
165
165
|
old_warden_proxy = warden
|
166
|
-
|
166
|
+
|
167
|
+
@request = if Devise::Test.rails51?
|
168
|
+
ActionController::TestRequest.create(Class.new) # needs a "controller class"
|
169
|
+
elsif Devise::Test.rails5?
|
170
|
+
ActionController::TestRequest.create
|
171
|
+
else
|
172
|
+
ActionController::TestRequest.new
|
173
|
+
end
|
174
|
+
|
167
175
|
new_warden_proxy = warden
|
168
176
|
|
169
177
|
assert_not_equal old_warden_proxy, new_warden_proxy
|
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.
|
4
|
+
version: 4.3.0
|
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: 2017-
|
12
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: warden
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
version: 4.1.0
|
63
63
|
- - "<"
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: '5.
|
65
|
+
version: '5.2'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
version: 4.1.0
|
73
73
|
- - "<"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '5.
|
75
|
+
version: '5.2'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: responders
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,6 +134,8 @@ files:
|
|
134
134
|
- gemfiles/Gemfile.rails-4.1-stable.lock
|
135
135
|
- gemfiles/Gemfile.rails-4.2-stable
|
136
136
|
- gemfiles/Gemfile.rails-4.2-stable.lock
|
137
|
+
- gemfiles/Gemfile.rails-5.0-stable
|
138
|
+
- gemfiles/Gemfile.rails-5.0-stable.lock
|
137
139
|
- guides/bug_report_templates/integration_test.rb
|
138
140
|
- lib/devise.rb
|
139
141
|
- lib/devise/controllers/helpers.rb
|
@@ -374,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
374
376
|
version: '0'
|
375
377
|
requirements: []
|
376
378
|
rubyforge_project:
|
377
|
-
rubygems_version: 2.
|
379
|
+
rubygems_version: 2.6.10
|
378
380
|
signing_key:
|
379
381
|
specification_version: 4
|
380
382
|
summary: Flexible authentication solution for Rails with Warden
|