devise 4.4.3 → 4.5.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.

Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -11
  3. data/CHANGELOG.md +23 -1
  4. data/Gemfile +2 -2
  5. data/Gemfile.lock +82 -73
  6. data/README.md +17 -18
  7. data/app/controllers/devise/registrations_controller.rb +1 -1
  8. data/app/controllers/devise_controller.rb +1 -1
  9. data/app/views/devise/passwords/edit.html.erb +1 -1
  10. data/app/views/devise/registrations/edit.html.erb +3 -3
  11. data/app/views/devise/registrations/new.html.erb +2 -2
  12. data/app/views/devise/sessions/new.html.erb +1 -1
  13. data/gemfiles/Gemfile.rails-4.1-stable.lock +2 -2
  14. data/gemfiles/Gemfile.rails-4.2-stable.lock +2 -2
  15. data/gemfiles/Gemfile.rails-5.0-stable.lock +2 -2
  16. data/gemfiles/Gemfile.rails-5.2-rc1.lock +2 -2
  17. data/guides/bug_report_templates/integration_test.rb +1 -1
  18. data/lib/devise/controllers/sign_in_out.rb +3 -0
  19. data/lib/devise/failure_app.rb +2 -0
  20. data/lib/devise/models/authenticatable.rb +31 -24
  21. data/lib/devise/models/database_authenticatable.rb +7 -7
  22. data/lib/devise/models/trackable.rb +8 -1
  23. data/lib/devise/parameter_filter.rb +2 -0
  24. data/lib/devise/parameter_sanitizer.rb +13 -1
  25. data/lib/devise/secret_key_finder.rb +2 -0
  26. data/lib/devise/strategies/database_authenticatable.rb +3 -1
  27. data/lib/devise/version.rb +1 -1
  28. data/lib/generators/active_record/devise_generator.rb +5 -5
  29. data/lib/generators/devise/orm_helpers.rb +2 -2
  30. data/lib/generators/mongoid/devise_generator.rb +5 -5
  31. data/lib/generators/templates/devise.rb +7 -0
  32. data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
  33. data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +6 -1
  34. data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
  35. data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -3
  36. data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
  37. data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
  38. data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
  39. data/test/failure_app_test.rb +6 -0
  40. data/test/integration/confirmable_test.rb +5 -5
  41. data/test/integration/database_authenticatable_test.rb +13 -0
  42. data/test/mailers/email_changed_test.rb +2 -2
  43. data/test/models/confirmable_test.rb +14 -14
  44. data/test/models/database_authenticatable_test.rb +10 -3
  45. data/test/models/trackable_test.rb +18 -0
  46. data/test/parameter_sanitizer_test.rb +28 -0
  47. data/test/rails_app/config/initializers/devise.rb +5 -0
  48. data/test/rails_app/lib/lazy_load_test_module.rb +5 -0
  49. data/test/secret_key_finder_test.rb +24 -0
  50. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 554c50f7db4c13beb0b2eb9ee1dbdd863aef2e7647de61d7070adac0b60fd1c7
4
- data.tar.gz: 7624cffe7f3383660d08bca3c10b4f0c3ce2d5696b1f52cfe2e8b2b023c79fed
3
+ metadata.gz: 4dc3a8679abb65b4043adcff5725822be38a9bfd7e686ac8c75b72ea2a705d12
4
+ data.tar.gz: de207546fe24041c7986acbe23ad9f672ff1086a71ed8e6b749b6c3e648097ab
5
5
  SHA512:
6
- metadata.gz: fa0cacb024cecbfb7a031f0dd5b5e8cf2ea518ecbd89b3f2d3994614bf8d859548984b4675f4cd1be1f73b17c0a07214e9d62e08e4d7362450664b27083bc1a4
7
- data.tar.gz: e249d22cc464e7b04b53e990ff0c6e15b3c48a1bb7e8d9ef0a10722b867649840b7b5d48b30f234e9963400b773608b31c3732aeb5665287cea940d568bb5abe
6
+ metadata.gz: fc02654fdc90c761e56a0aac94eebcadf605c92bfaf57821c305dd73f76ac7670a3da408ee757dba5726b25911c391d28df940cd76e098b4b8e370785d9749f5
7
+ data.tar.gz: 28f0415a206541711baa0b0d23e718e13d12e22f712eae84309ddf2f9b76feace59ffbc6fdacd70f48e4bcb8c574492d076105154a4ab4f47f9be3e33e58d69b
@@ -2,10 +2,10 @@ language: ruby
2
2
 
3
3
  rvm:
4
4
  - 2.1.10
5
- - 2.2.8
6
- - 2.3.5
7
- - 2.4.2
8
- - 2.5.0
5
+ - 2.2.10
6
+ - 2.3.7
7
+ - 2.4.4
8
+ - 2.5.1
9
9
  - ruby-head
10
10
 
11
11
  gemfile:
@@ -21,16 +21,16 @@ matrix:
21
21
  gemfile: Gemfile
22
22
  - rvm: 2.1.10
23
23
  gemfile: gemfiles/Gemfile.rails-5.2-rc1
24
- - rvm: 2.5.0
24
+ - rvm: 2.1.10
25
+ gemfile: gemfiles/Gemfile.rails-5.0-stable
26
+ - rvm: 2.2.10
27
+ gemfile: gemfiles/Gemfile.rails-5.2-rc1
28
+ - rvm: 2.4.4
25
29
  gemfile: gemfiles/Gemfile.rails-4.1-stable
26
- - rvm: 2.4.2
30
+ - rvm: 2.5.1
27
31
  gemfile: gemfiles/Gemfile.rails-4.1-stable
28
32
  - rvm: ruby-head
29
33
  gemfile: gemfiles/Gemfile.rails-4.1-stable
30
- - rvm: 2.1.10
31
- gemfile: gemfiles/Gemfile.rails-5.0-stable
32
- - rvm: 2.1.10
33
- gemfile: Gemfile
34
34
  - env: DEVISE_ORM=mongoid
35
35
  gemfile: Gemfile
36
36
  - env: DEVISE_ORM=mongoid
@@ -52,8 +52,9 @@ env:
52
52
  - DEVISE_ORM=mongoid
53
53
 
54
54
  before_install:
55
- - "rm ${BUNDLE_GEMFILE}.lock"
56
55
  - gem update --system
56
+ - gem install bundler
57
+ - "rm ${BUNDLE_GEMFILE}.lock"
57
58
 
58
59
  before_script: "bundle update"
59
60
 
@@ -1,5 +1,27 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 4.5.0 - 2018-08-15
4
+
5
+ * enhancements
6
+ * Use `before_action` instead of `before_filter` (by @edenthecat)
7
+ * Allow people to extend devise failure app, through invoking `ActiveSupport.run_load_hooks` once `Devise::FailureApp` is loaded (by @wnm)
8
+ * Use `update` instead of `update_attributes` (by @koic)
9
+ * Split IP resolution from `update_tracked_fields` (by @mckramer)
10
+ * upgrade dependencies for rails and responders (by @lancecarlson)
11
+ * Add `autocomplete="new-password"` to new password fields (by @gssbzn)
12
+ * Add `autocomplete="current-password"` to current password fields (by @gssbzn)
13
+ * Remove redundant `self` from `database_authenticatable` module (by @abhishekkanojia)
14
+ * Update `simple_form` templates with changes from https://github.com/plataformatec/devise/commit/16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and https://github.com/plataformatec/devise/commit/6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn)
15
+ * Remove `:trackable` from the default modules in the generators, to be more GDPR-friendly (by @fakenine)
16
+
17
+ * bug fixes
18
+ * Use same string on failed login regardless of whether account exists when in paranoid mode (by @TonyMK9068)
19
+ * Fix error when params is not a hash inside `Devise::ParameterSanitizer` (by @b0nn1e)
20
+ * Look for `secret_key_base` inside `Rails.application` (by @gencer)
21
+ * Ensure `Devise::ParameterFilter` does not add missing keys when called with a hash that has a `default` / `default_proc`
22
+ configured (by @joshpencheon)
23
+ * Adds `is_navigational_format?` check to `after_sign_up_path_for` to keep consistency (by @iorme1)
24
+
3
25
  ### 4.4.3 - 2018-03-17
4
26
 
5
27
  * bug fixes
@@ -44,7 +66,7 @@
44
66
  * Validations were being ignored on singup in the `Trackable#update_tracked_fields!` method. (by @AshleyFoster)
45
67
  * Do not modify options for `#serializable_hash`. (by @guigs)
46
68
  * Email confirmations were being sent on sign in/sign out for application using `mongoid` and `mongoid-paperclip` gems. This is because previously we were checking if a model is from Active Record by checking if the method `after_commit` was defined - since `mongoid` doesn' have one - but `mongoid-paperclip` gem does define one, which cause this issue. (by @fjg)
47
-
69
+
48
70
  ### 4.3.0 - 2017-05-14
49
71
 
50
72
  * Enhancements
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- gem "rails", "~> 5.1"
7
+ gem "rails", "~> 5.2"
8
8
  gem "omniauth", "~> 1.3"
9
9
  gem "oauth2"
10
10
  gem "omniauth-oauth2"
@@ -14,7 +14,7 @@ gem "activemodel-serializers-xml", github: "rails/activemodel-serializers-xml"
14
14
 
15
15
  gem "rails-controller-testing"
16
16
 
17
- gem "responders", "~> 2.1"
17
+ gem "responders", "~> 2.4"
18
18
 
19
19
  group :test do
20
20
  gem "omniauth-facebook"
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- devise (4.4.3)
13
+ devise (4.5.0)
14
14
  bcrypt (~> 3.0)
15
15
  orm_adapter (~> 0.1)
16
16
  railties (>= 4.1.0, < 6.0)
@@ -20,81 +20,89 @@ PATH
20
20
  GEM
21
21
  remote: https://rubygems.org/
22
22
  specs:
23
- actioncable (5.1.0)
24
- actionpack (= 5.1.0)
23
+ actioncable (5.2.0)
24
+ actionpack (= 5.2.0)
25
25
  nio4r (~> 2.0)
26
- websocket-driver (~> 0.6.1)
27
- actionmailer (5.1.0)
28
- actionpack (= 5.1.0)
29
- actionview (= 5.1.0)
30
- activejob (= 5.1.0)
26
+ websocket-driver (>= 0.6.1)
27
+ actionmailer (5.2.0)
28
+ actionpack (= 5.2.0)
29
+ actionview (= 5.2.0)
30
+ activejob (= 5.2.0)
31
31
  mail (~> 2.5, >= 2.5.4)
32
32
  rails-dom-testing (~> 2.0)
33
- actionpack (5.1.0)
34
- actionview (= 5.1.0)
35
- activesupport (= 5.1.0)
33
+ actionpack (5.2.0)
34
+ actionview (= 5.2.0)
35
+ activesupport (= 5.2.0)
36
36
  rack (~> 2.0)
37
- rack-test (~> 0.6.3)
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.1.0)
41
- activesupport (= 5.1.0)
40
+ actionview (5.2.0)
41
+ activesupport (= 5.2.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.1.0)
47
- activesupport (= 5.1.0)
46
+ activejob (5.2.0)
47
+ activesupport (= 5.2.0)
48
48
  globalid (>= 0.3.6)
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)
49
+ activemodel (5.2.0)
50
+ activesupport (= 5.2.0)
51
+ activerecord (5.2.0)
52
+ activemodel (= 5.2.0)
53
+ activesupport (= 5.2.0)
54
+ arel (>= 9.0)
55
+ activestorage (5.2.0)
56
+ actionpack (= 5.2.0)
57
+ activerecord (= 5.2.0)
58
+ marcel (~> 0.3.1)
59
+ activesupport (5.2.0)
56
60
  concurrent-ruby (~> 1.0, >= 1.0.2)
57
- i18n (~> 0.7)
61
+ i18n (>= 0.7, < 2)
58
62
  minitest (~> 5.1)
59
63
  tzinfo (~> 1.1)
60
- arel (8.0.0)
61
- bcrypt (3.1.11)
64
+ arel (9.0.0)
65
+ bcrypt (3.1.12)
62
66
  builder (3.2.3)
63
67
  concurrent-ruby (1.0.5)
64
- erubi (1.6.0)
68
+ crass (1.0.4)
69
+ erubi (1.7.1)
65
70
  faraday (0.11.0)
66
71
  multipart-post (>= 1.2, < 3)
67
- globalid (0.4.0)
72
+ globalid (0.4.1)
68
73
  activesupport (>= 4.2.0)
69
- hashie (3.5.5)
70
- i18n (0.8.1)
74
+ hashie (3.5.7)
75
+ i18n (1.0.0)
76
+ concurrent-ruby (~> 1.0)
71
77
  jwt (1.5.6)
72
- loofah (2.0.3)
78
+ loofah (2.2.2)
79
+ crass (~> 1.0.2)
73
80
  nokogiri (>= 1.5.9)
74
- mail (2.6.5)
75
- mime-types (>= 1.16, < 4)
81
+ mail (2.7.0)
82
+ mini_mime (>= 0.1.1)
83
+ marcel (0.3.2)
84
+ mimemagic (~> 0.3.2)
76
85
  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)
86
+ method_source (0.9.0)
87
+ mimemagic (0.3.2)
88
+ mini_mime (1.0.0)
89
+ mini_portile2 (2.3.0)
90
+ minitest (5.11.3)
83
91
  mocha (1.2.1)
84
92
  metaclass (~> 0.0.1)
85
93
  multi_json (1.12.1)
86
94
  multi_xml (0.6.0)
87
95
  multipart-post (2.0.0)
88
- nio4r (2.0.0)
89
- nokogiri (1.7.1)
90
- mini_portile2 (~> 2.1.0)
96
+ nio4r (2.3.0)
97
+ nokogiri (1.8.2)
98
+ mini_portile2 (~> 2.3.0)
91
99
  oauth2 (1.3.1)
92
100
  faraday (>= 0.8, < 0.12)
93
101
  jwt (~> 1.0)
94
102
  multi_json (~> 1.3)
95
103
  multi_xml (~> 0.5)
96
104
  rack (>= 1.2, < 3)
97
- omniauth (1.6.1)
105
+ omniauth (1.8.1)
98
106
  hashie (>= 3.4.6, < 3.6.0)
99
107
  rack (>= 1.6.2, < 3)
100
108
  omniauth-facebook (4.0.0)
@@ -106,40 +114,41 @@ GEM
106
114
  omniauth (~> 1.0)
107
115
  rack-openid (~> 1.3.1)
108
116
  orm_adapter (0.5.0)
109
- rack (2.0.1)
117
+ rack (2.0.4)
110
118
  rack-openid (1.3.1)
111
119
  rack (>= 1.1.0)
112
120
  ruby-openid (>= 2.1.8)
113
- rack-test (0.6.3)
114
- rack (>= 1.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
- bundler (>= 1.3.0, < 2.0)
125
- railties (= 5.1.0)
121
+ rack-test (1.0.0)
122
+ rack (>= 1.0, < 3)
123
+ rails (5.2.0)
124
+ actioncable (= 5.2.0)
125
+ actionmailer (= 5.2.0)
126
+ actionpack (= 5.2.0)
127
+ actionview (= 5.2.0)
128
+ activejob (= 5.2.0)
129
+ activemodel (= 5.2.0)
130
+ activerecord (= 5.2.0)
131
+ activestorage (= 5.2.0)
132
+ activesupport (= 5.2.0)
133
+ bundler (>= 1.3.0)
134
+ railties (= 5.2.0)
126
135
  sprockets-rails (>= 2.0.0)
127
136
  rails-controller-testing (1.0.1)
128
137
  actionpack (~> 5.x)
129
138
  actionview (~> 5.x)
130
139
  activesupport (~> 5.x)
131
- rails-dom-testing (2.0.2)
132
- activesupport (>= 4.2.0, < 6.0)
133
- nokogiri (~> 1.6)
134
- rails-html-sanitizer (1.0.3)
135
- loofah (~> 2.0)
136
- railties (5.1.0)
137
- actionpack (= 5.1.0)
138
- activesupport (= 5.1.0)
140
+ rails-dom-testing (2.0.3)
141
+ activesupport (>= 4.2.0)
142
+ nokogiri (>= 1.6)
143
+ rails-html-sanitizer (1.0.4)
144
+ loofah (~> 2.2, >= 2.2.2)
145
+ railties (5.2.0)
146
+ actionpack (= 5.2.0)
147
+ activesupport (= 5.2.0)
139
148
  method_source
140
149
  rake (>= 0.8.7)
141
150
  thor (>= 0.18.1, < 2.0)
142
- rake (12.0.0)
151
+ rake (12.3.1)
143
152
  rdoc (5.1.0)
144
153
  responders (2.4.0)
145
154
  actionpack (>= 4.2.0, < 5.3)
@@ -148,14 +157,14 @@ GEM
148
157
  sprockets (3.7.1)
149
158
  concurrent-ruby (~> 1.0)
150
159
  rack (> 1, < 3)
151
- sprockets-rails (3.2.0)
160
+ sprockets-rails (3.2.1)
152
161
  actionpack (>= 4.0)
153
162
  activesupport (>= 4.0)
154
163
  sprockets (>= 3.0.0)
155
164
  sqlite3 (1.3.13)
156
- thor (0.19.4)
165
+ thor (0.20.0)
157
166
  thread_safe (0.3.6)
158
- tzinfo (1.2.3)
167
+ tzinfo (1.2.5)
159
168
  thread_safe (~> 0.1)
160
169
  warden (1.2.7)
161
170
  rack (>= 1.0)
@@ -163,9 +172,9 @@ GEM
163
172
  nokogiri (>= 1.2.0)
164
173
  rack (>= 1.0)
165
174
  rack-test (>= 0.5.3)
166
- websocket-driver (0.6.5)
175
+ websocket-driver (0.7.0)
167
176
  websocket-extensions (>= 0.1.0)
168
- websocket-extensions (0.1.2)
177
+ websocket-extensions (0.1.3)
169
178
 
170
179
  PLATFORMS
171
180
  ruby
@@ -182,10 +191,10 @@ DEPENDENCIES
182
191
  omniauth-facebook
183
192
  omniauth-oauth2
184
193
  omniauth-openid
185
- rails (~> 5.1)
194
+ rails (~> 5.2)
186
195
  rails-controller-testing
187
196
  rdoc
188
- responders (~> 2.1)
197
+ responders (~> 2.4)
189
198
  sqlite3
190
199
  webrat (= 0.7.3)
191
200
 
data/README.md CHANGED
@@ -16,16 +16,16 @@ Devise is a flexible authentication solution for Rails based on Warden. It:
16
16
 
17
17
  It's composed of 10 modules:
18
18
 
19
- * [Database Authenticatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable): hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.
20
- * [Omniauthable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support.
21
- * [Confirmable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.
22
- * [Recoverable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions.
23
- * [Registerable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account.
24
- * [Rememberable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie.
25
- * [Trackable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address.
26
- * [Timeoutable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable): expires sessions that have not been active in a specified period of time.
27
- * [Validatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable): provides validations of email and password. It's optional and can be customized, so you're able to define your own validations.
28
- * [Lockable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Lockable): locks an account after a specified number of failed sign-in attempts. Can unlock via email or after a specified time period.
19
+ * [Database Authenticatable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable): hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.
20
+ * [Omniauthable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support.
21
+ * [Confirmable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.
22
+ * [Recoverable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions.
23
+ * [Registerable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account.
24
+ * [Rememberable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie.
25
+ * [Trackable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address.
26
+ * [Timeoutable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable): expires sessions that have not been active in a specified period of time.
27
+ * [Validatable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable): provides validations of email and password. It's optional and can be customized, so you're able to define your own validations.
28
+ * [Lockable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Lockable): locks an account after a specified number of failed sign-in attempts. Can unlock via email or after a specified time period.
29
29
 
30
30
  ## Table of Contents
31
31
 
@@ -53,11 +53,6 @@ It's composed of 10 modules:
53
53
  - [Integration tests](#integration-tests)
54
54
  - [OmniAuth](#omniauth)
55
55
  - [Configuring multiple models](#configuring-multiple-models)
56
- - [Create a migration with the required fields](#create-a-migration-with-the-required-fields)
57
- - [Inside your Admin model](#inside-your-admin-model)
58
- - [Inside your routes](#inside-your-routes)
59
- - [Inside your protected controller](#inside-your-protected-controller)
60
- - [Inside your controllers and views](#inside-your-controllers-and-views)
61
56
  - [ActiveJob Integration](#activejob-integration)
62
57
  - [Password reset tokens and Rails logs](#password-reset-tokens-and-rails-logs)
63
58
  - [Other ORMs](#other-orms)
@@ -140,7 +135,7 @@ Please note that the command output will show the variable value being used.
140
135
 
141
136
  ### BUNDLE_GEMFILE
142
137
  We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory).
143
- Inside the [gemfiles](https://github.com/plataformatec/devise/tree/master/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite brakes on Travis using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable.
138
+ Inside the [gemfiles](https://github.com/plataformatec/devise/tree/master/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite breaks on Travis using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable.
144
139
  For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following:
145
140
  ```bash
146
141
  rbenv shell 2.4.2 # or rvm use 2.4.2
@@ -166,7 +161,7 @@ Once you have solidified your understanding of Rails and authentication mechanis
166
161
 
167
162
  ## Getting started
168
163
 
169
- Devise 4.0 works with Rails 4.1 onwards. You can add it to your Gemfile with:
164
+ Devise 4.0 works with Rails 4.1 onwards. Add the following line to your Gemfile:
170
165
 
171
166
  ```ruby
172
167
  gem 'devise'
@@ -195,7 +190,7 @@ In the following command you will replace `MODEL` with the class name used for t
195
190
  $ rails generate devise MODEL
196
191
  ```
197
192
 
198
- 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.
193
+ 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.
199
194
 
200
195
  Then run `rails db:migrate`
201
196
 
@@ -404,6 +399,7 @@ If the customization at the views level is not enough, you can customize each co
404
399
  ...
405
400
  end
406
401
  ```
402
+ (Use the -c flag to specify a controller, for example: `rails generate devise:controllers users -c=sessions`)
407
403
 
408
404
  2. Tell the router to use this controller:
409
405
 
@@ -519,6 +515,9 @@ cases/specs.
519
515
 
520
516
  Controller tests require that you include `Devise::Test::ControllerHelpers` on
521
517
  your test case or its parent `ActionController::TestCase` superclass.
518
+ For Rails 5, include `Devise::Test::IntegrationHelpers` instead, since the superclass
519
+ for controller tests has been changed to ActionDispatch::IntegrationTest
520
+ (for more details, see the [Integration tests](#integration-tests) section).
522
521
 
523
522
  ```ruby
524
523
  class PostsControllerTest < ActionController::TestCase
@@ -112,7 +112,7 @@ class Devise::RegistrationsController < DeviseController
112
112
  # The path used after sign up. You need to overwrite this method
113
113
  # in your own RegistrationsController.
114
114
  def after_sign_up_path_for(resource)
115
- after_sign_in_path_for(resource)
115
+ after_sign_in_path_for(resource) if is_navigational_format?
116
116
  end
117
117
 
118
118
  # The path used after sign up for inactive accounts. You need to overwrite