devise 3.2.0 → 4.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +260 -949
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +383 -100
  5. data/app/controllers/devise/confirmations_controller.rb +13 -5
  6. data/app/controllers/devise/omniauth_callbacks_controller.rb +12 -6
  7. data/app/controllers/devise/passwords_controller.rb +23 -8
  8. data/app/controllers/devise/registrations_controller.rb +60 -24
  9. data/app/controllers/devise/sessions_controller.rb +48 -16
  10. data/app/controllers/devise/unlocks_controller.rb +11 -4
  11. data/app/controllers/devise_controller.rb +67 -31
  12. data/app/helpers/devise_helper.rb +12 -19
  13. data/app/mailers/devise/mailer.rb +10 -0
  14. data/app/views/devise/confirmations/new.html.erb +9 -5
  15. data/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
  16. data/app/views/devise/mailer/email_changed.html.erb +7 -0
  17. data/app/views/devise/mailer/password_change.html.erb +3 -0
  18. data/app/views/devise/mailer/reset_password_instructions.html.erb +1 -1
  19. data/app/views/devise/mailer/unlock_instructions.html.erb +1 -1
  20. data/app/views/devise/passwords/edit.html.erb +16 -7
  21. data/app/views/devise/passwords/new.html.erb +9 -5
  22. data/app/views/devise/registrations/edit.html.erb +29 -15
  23. data/app/views/devise/registrations/new.html.erb +20 -9
  24. data/app/views/devise/sessions/new.html.erb +19 -10
  25. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  26. data/app/views/devise/shared/{_links.erb → _links.html.erb} +9 -9
  27. data/app/views/devise/unlocks/new.html.erb +9 -5
  28. data/config/locales/en.yml +23 -17
  29. data/lib/devise/controllers/helpers.rb +113 -49
  30. data/lib/devise/controllers/rememberable.rb +15 -6
  31. data/lib/devise/controllers/scoped_views.rb +3 -1
  32. data/lib/devise/controllers/sign_in_out.rb +42 -26
  33. data/lib/devise/controllers/store_location.rb +76 -0
  34. data/lib/devise/controllers/url_helpers.rb +9 -7
  35. data/lib/devise/delegator.rb +2 -0
  36. data/lib/devise/encryptor.rb +24 -0
  37. data/lib/devise/failure_app.rb +122 -40
  38. data/lib/devise/hooks/activatable.rb +7 -6
  39. data/lib/devise/hooks/csrf_cleaner.rb +5 -1
  40. data/lib/devise/hooks/forgetable.rb +2 -0
  41. data/lib/devise/hooks/lockable.rb +7 -2
  42. data/lib/devise/hooks/proxy.rb +4 -2
  43. data/lib/devise/hooks/rememberable.rb +4 -2
  44. data/lib/devise/hooks/timeoutable.rb +16 -9
  45. data/lib/devise/hooks/trackable.rb +3 -1
  46. data/lib/devise/mailers/helpers.rb +15 -12
  47. data/lib/devise/mapping.rb +8 -2
  48. data/lib/devise/models/authenticatable.rb +81 -56
  49. data/lib/devise/models/confirmable.rb +137 -42
  50. data/lib/devise/models/database_authenticatable.rb +114 -28
  51. data/lib/devise/models/lockable.rb +30 -17
  52. data/lib/devise/models/omniauthable.rb +3 -1
  53. data/lib/devise/models/recoverable.rb +62 -26
  54. data/lib/devise/models/registerable.rb +4 -0
  55. data/lib/devise/models/rememberable.rb +62 -33
  56. data/lib/devise/models/timeoutable.rb +4 -8
  57. data/lib/devise/models/trackable.rb +20 -4
  58. data/lib/devise/models/validatable.rb +16 -9
  59. data/lib/devise/models.rb +3 -1
  60. data/lib/devise/modules.rb +12 -10
  61. data/lib/devise/omniauth/config.rb +2 -0
  62. data/lib/devise/omniauth/url_helpers.rb +14 -5
  63. data/lib/devise/omniauth.rb +2 -0
  64. data/lib/devise/orm/active_record.rb +5 -1
  65. data/lib/devise/orm/mongoid.rb +6 -2
  66. data/lib/devise/parameter_filter.rb +4 -0
  67. data/lib/devise/parameter_sanitizer.rb +139 -65
  68. data/lib/devise/rails/routes.rb +150 -104
  69. data/lib/devise/rails/warden_compat.rb +3 -10
  70. data/lib/devise/rails.rb +10 -13
  71. data/lib/devise/secret_key_finder.rb +27 -0
  72. data/lib/devise/strategies/authenticatable.rb +21 -10
  73. data/lib/devise/strategies/base.rb +3 -1
  74. data/lib/devise/strategies/database_authenticatable.rb +15 -4
  75. data/lib/devise/strategies/rememberable.rb +15 -3
  76. data/lib/devise/test/controller_helpers.rb +165 -0
  77. data/lib/devise/test/integration_helpers.rb +63 -0
  78. data/lib/devise/test_helpers.rb +7 -124
  79. data/lib/devise/time_inflector.rb +4 -2
  80. data/lib/devise/token_generator.rb +3 -41
  81. data/lib/devise/version.rb +3 -1
  82. data/lib/devise.rb +111 -83
  83. data/lib/generators/active_record/devise_generator.rb +49 -12
  84. data/lib/generators/active_record/templates/migration.rb +9 -7
  85. data/lib/generators/active_record/templates/migration_existing.rb +9 -7
  86. data/lib/generators/devise/controllers_generator.rb +46 -0
  87. data/lib/generators/devise/devise_generator.rb +9 -5
  88. data/lib/generators/devise/install_generator.rb +22 -0
  89. data/lib/generators/devise/orm_helpers.rb +10 -21
  90. data/lib/generators/devise/views_generator.rb +51 -28
  91. data/lib/generators/mongoid/devise_generator.rb +22 -19
  92. data/lib/generators/templates/README +5 -12
  93. data/lib/generators/templates/controllers/README +14 -0
  94. data/lib/generators/templates/controllers/confirmations_controller.rb +30 -0
  95. data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +30 -0
  96. data/lib/generators/templates/controllers/passwords_controller.rb +34 -0
  97. data/lib/generators/templates/controllers/registrations_controller.rb +62 -0
  98. data/lib/generators/templates/controllers/sessions_controller.rb +27 -0
  99. data/lib/generators/templates/controllers/unlocks_controller.rb +30 -0
  100. data/lib/generators/templates/devise.rb +81 -36
  101. data/lib/generators/templates/markerb/confirmation_instructions.markerb +1 -1
  102. data/lib/generators/templates/markerb/email_changed.markerb +7 -0
  103. data/lib/generators/templates/markerb/password_change.markerb +3 -0
  104. data/lib/generators/templates/markerb/reset_password_instructions.markerb +1 -1
  105. data/lib/generators/templates/markerb/unlock_instructions.markerb +1 -1
  106. data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +6 -2
  107. data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +12 -4
  108. data/lib/generators/templates/simple_form_for/passwords/new.html.erb +5 -2
  109. data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +14 -6
  110. data/lib/generators/templates/simple_form_for/registrations/new.html.erb +12 -4
  111. data/lib/generators/templates/simple_form_for/sessions/new.html.erb +11 -6
  112. data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +5 -2
  113. metadata +46 -280
  114. data/.gitignore +0 -10
  115. data/.travis.yml +0 -20
  116. data/.yardopts +0 -9
  117. data/CONTRIBUTING.md +0 -14
  118. data/Gemfile +0 -31
  119. data/Gemfile.lock +0 -160
  120. data/Rakefile +0 -35
  121. data/devise.gemspec +0 -27
  122. data/devise.png +0 -0
  123. data/gemfiles/Gemfile.rails-3.2.x +0 -31
  124. data/gemfiles/Gemfile.rails-3.2.x.lock +0 -159
  125. data/test/controllers/custom_strategy_test.rb +0 -62
  126. data/test/controllers/helpers_test.rb +0 -253
  127. data/test/controllers/internal_helpers_test.rb +0 -120
  128. data/test/controllers/passwords_controller_test.rb +0 -31
  129. data/test/controllers/sessions_controller_test.rb +0 -99
  130. data/test/controllers/url_helpers_test.rb +0 -59
  131. data/test/delegator_test.rb +0 -19
  132. data/test/devise_test.rb +0 -94
  133. data/test/failure_app_test.rb +0 -232
  134. data/test/generators/active_record_generator_test.rb +0 -103
  135. data/test/generators/devise_generator_test.rb +0 -39
  136. data/test/generators/install_generator_test.rb +0 -13
  137. data/test/generators/mongoid_generator_test.rb +0 -23
  138. data/test/generators/views_generator_test.rb +0 -67
  139. data/test/helpers/devise_helper_test.rb +0 -51
  140. data/test/integration/authenticatable_test.rb +0 -713
  141. data/test/integration/confirmable_test.rb +0 -284
  142. data/test/integration/database_authenticatable_test.rb +0 -84
  143. data/test/integration/http_authenticatable_test.rb +0 -105
  144. data/test/integration/lockable_test.rb +0 -239
  145. data/test/integration/omniauthable_test.rb +0 -133
  146. data/test/integration/recoverable_test.rb +0 -334
  147. data/test/integration/registerable_test.rb +0 -349
  148. data/test/integration/rememberable_test.rb +0 -167
  149. data/test/integration/timeoutable_test.rb +0 -178
  150. data/test/integration/trackable_test.rb +0 -92
  151. data/test/mailers/confirmation_instructions_test.rb +0 -115
  152. data/test/mailers/reset_password_instructions_test.rb +0 -96
  153. data/test/mailers/unlock_instructions_test.rb +0 -91
  154. data/test/mapping_test.rb +0 -127
  155. data/test/models/authenticatable_test.rb +0 -13
  156. data/test/models/confirmable_test.rb +0 -454
  157. data/test/models/database_authenticatable_test.rb +0 -244
  158. data/test/models/lockable_test.rb +0 -298
  159. data/test/models/omniauthable_test.rb +0 -7
  160. data/test/models/recoverable_test.rb +0 -184
  161. data/test/models/registerable_test.rb +0 -7
  162. data/test/models/rememberable_test.rb +0 -183
  163. data/test/models/serializable_test.rb +0 -49
  164. data/test/models/timeoutable_test.rb +0 -51
  165. data/test/models/trackable_test.rb +0 -13
  166. data/test/models/validatable_test.rb +0 -127
  167. data/test/models_test.rb +0 -144
  168. data/test/omniauth/config_test.rb +0 -57
  169. data/test/omniauth/url_helpers_test.rb +0 -54
  170. data/test/orm/active_record.rb +0 -10
  171. data/test/orm/mongoid.rb +0 -13
  172. data/test/parameter_sanitizer_test.rb +0 -81
  173. data/test/rails_app/Rakefile +0 -6
  174. data/test/rails_app/app/active_record/admin.rb +0 -6
  175. data/test/rails_app/app/active_record/shim.rb +0 -2
  176. data/test/rails_app/app/active_record/user.rb +0 -6
  177. data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -6
  178. data/test/rails_app/app/controllers/admins_controller.rb +0 -11
  179. data/test/rails_app/app/controllers/application_controller.rb +0 -9
  180. data/test/rails_app/app/controllers/home_controller.rb +0 -25
  181. data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -2
  182. data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -2
  183. data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -14
  184. data/test/rails_app/app/controllers/users_controller.rb +0 -31
  185. data/test/rails_app/app/helpers/application_helper.rb +0 -3
  186. data/test/rails_app/app/mailers/users/mailer.rb +0 -12
  187. data/test/rails_app/app/mongoid/admin.rb +0 -29
  188. data/test/rails_app/app/mongoid/shim.rb +0 -23
  189. data/test/rails_app/app/mongoid/user.rb +0 -39
  190. data/test/rails_app/app/views/admins/index.html.erb +0 -1
  191. data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
  192. data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
  193. data/test/rails_app/app/views/home/index.html.erb +0 -1
  194. data/test/rails_app/app/views/home/join.html.erb +0 -1
  195. data/test/rails_app/app/views/home/private.html.erb +0 -1
  196. data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
  197. data/test/rails_app/app/views/layouts/application.html.erb +0 -24
  198. data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
  199. data/test/rails_app/app/views/users/index.html.erb +0 -1
  200. data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
  201. data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
  202. data/test/rails_app/bin/bundle +0 -3
  203. data/test/rails_app/bin/rails +0 -4
  204. data/test/rails_app/bin/rake +0 -4
  205. data/test/rails_app/config/application.rb +0 -40
  206. data/test/rails_app/config/boot.rb +0 -8
  207. data/test/rails_app/config/database.yml +0 -18
  208. data/test/rails_app/config/environment.rb +0 -5
  209. data/test/rails_app/config/environments/development.rb +0 -34
  210. data/test/rails_app/config/environments/production.rb +0 -84
  211. data/test/rails_app/config/environments/test.rb +0 -36
  212. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  213. data/test/rails_app/config/initializers/devise.rb +0 -181
  214. data/test/rails_app/config/initializers/inflections.rb +0 -2
  215. data/test/rails_app/config/initializers/secret_token.rb +0 -8
  216. data/test/rails_app/config/initializers/session_store.rb +0 -1
  217. data/test/rails_app/config/routes.rb +0 -104
  218. data/test/rails_app/config.ru +0 -4
  219. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -71
  220. data/test/rails_app/db/schema.rb +0 -51
  221. data/test/rails_app/lib/shared_admin.rb +0 -17
  222. data/test/rails_app/lib/shared_user.rb +0 -29
  223. data/test/rails_app/public/404.html +0 -26
  224. data/test/rails_app/public/422.html +0 -26
  225. data/test/rails_app/public/500.html +0 -26
  226. data/test/rails_app/public/favicon.ico +0 -0
  227. data/test/routes_test.rb +0 -250
  228. data/test/support/assertions.rb +0 -40
  229. data/test/support/helpers.rb +0 -70
  230. data/test/support/integration.rb +0 -92
  231. data/test/support/locale/en.yml +0 -8
  232. data/test/support/webrat/integrations/rails.rb +0 -24
  233. data/test/test_helper.rb +0 -34
  234. data/test/test_helpers_test.rb +0 -173
  235. data/test/test_models.rb +0 -26
data/CHANGELOG.md CHANGED
@@ -1,1008 +1,319 @@
1
- ### 3.2.0
1
+ ### Unreleased
2
2
 
3
- * enhancements
4
- * Previously deprecated token authenticatable and insecure lookups have been removed
5
- * Add a class method so you can encrypt passwords from fixtures (by @tenderlove)
6
- * Send custom message when user enters invalid password and it has only one attempt
7
- to enter correct password before his account will be locked (by @Lightpower)
8
- * Prevent mutation of values assigned to case and whitespace santitized members (by @iamvery)
9
- * Separate redirects and flash messages in `navigational_formats` and `flashing_formats` (by @ssendev)
10
-
11
- * bug fix
12
- * A GET to sign_in page shouldn't extend the session (by @drewish)
13
- * Splat the arguments to `strong_parameters#permit` to work around a limitation in the `strong_parameters` gem (by @memberful)
14
- * Omniauth now uses `mapping.fullpath` when generating routes. This means if you call `devise_for :users` inside a scope, like `scope "/api"`, the scope will now apply to the omniauth route (by @AlexanderZaytsev)
15
- * Ensure timeoutable hook respects `Devise.sign_out_all_scopes` configuration
16
-
17
- * deprecations
18
- * `expire_session_data_after_sign_in!` has been deprecated in favor of `expire_data_after_sign_in!`
19
-
20
- ### 3.1.1
21
-
22
- * bug fix
23
- * Improve default message which asked users to sign in even when they were already signed (by @gregates)
24
- * Improve error message for when the config.secret_key is missing
25
-
26
- ### 3.1.0
27
-
28
- Security announcement: http://blog.plataformatec.com.br/2013/08/devise-3-1-now-with-more-secure-defaults/
29
-
30
- * backwards incompatible changes
31
- * Do not store confirmation, unlock and reset password tokens directly in the database. This means tokens previously stored in the database are no longer valid. You can reenable this temporarily by setting `config.allow_insecure_token_lookup = true` in your configuration file. It is recommended to keep this configuration set to true just temporarily in your production servers only to aid migration
32
- * The Devise mailer and its views were changed to explicitly receive a token argument as `@token`. You will need to update your mailers and re-copy the views to your application with `rails g devise:views`
33
- * Sanitization of parameters should be done by calling `devise_parameter_sanitizer.sanitize(:action)` instead of `devise_parameter_sanitizer.for(:action)`
34
-
35
- * deprecations
36
- * Token authentication is deprecated
37
-
38
- * enhancements
39
- * Better security defaults
40
- * Allow easier customization of parameter sanitizer (by @alexpeattie)
41
-
42
- * bug fix
43
- * Do not confirm e-mail after password reset (by @moll)
44
- * Do not sign in after confirmation
45
- * Do not store confirmation, unlock and reset password tokens directly in the database
46
- * Do not compare directly against confirmation, unlock and reset password tokens
47
- * Skip storage for cookies on unverified requests
48
-
49
- ### 3.0.2
50
-
51
- * bug fix
52
- * Skip storage for cookies on unverified requests
53
-
54
- ### 3.0.1
55
-
56
- Security announcement: http://blog.plataformatec.com.br/2013/08/csrf-token-fixation-attacks-in-devise/
57
-
58
- * enhancements
59
- * Add after_confirmation callback
60
-
61
- * bug fix
62
- * When using rails 3.2, the generator adds 'attr_accessible' to the model (by @jcoyne)
63
- * Clean up CSRF token after authentication (by @homakov). Notice this change will clean up the CSRF Token after authentication (sign in, sign up, etc). So if you are using AJAX for such features, you will need to fetch a new CSRF token from the server.
64
-
65
- ### 3.0.0
66
-
67
- * enhancements
68
- * Rails 4 and Strong Parameters compatibility (by @carlosantoniodasilva, @josevalim, @latortuga, @lucasmazza, @nashby, @rafaelfranca, @spastorino)
69
- * Drop support for Rails < 3.2 and Ruby < 1.9.3
70
- * Enable to skip sending reconfirmation email when reconfirmable is on and `skip_confirmation_notification!` is invoked (by @tkhr)
71
-
72
- * bug fix
73
- * Errors on unlock are now properly reflected on the first `unlock_keys`
74
-
75
- * backwards incompatible changes
76
- * Changes on session storage will expire all existing sessions on upgrade. For those storing the session in the DB, they can be upgraded according to this gist: https://gist.github.com/moll/6417606
77
-
78
- ### 2.2.4
79
-
80
- * enhancements
81
- * Add `destroy_with_password` to `DatabaseAuthenticatable`. Allows destroying a record when `:current_password` matches, similarly to how `update_with_password` works. (by @michiel3)
82
- * Allow to override path after password resetting (by @worker8)
83
- * Add `#skip_confirmation_notification!` method to `Confirmable`. Allows skipping confirmation email without auto-confirming. (by @gregates)
84
- * allow_unconfirmed_access_for config from `:confirmable` module can be set to `nil` that means unconfirmed access for unlimited time. (by @nashby)
85
- * Support Rails' token strategy on authentication (by @robhurring)
86
- * Support explicitly setting the http authentication key via `config.http_authentication_key` (by @neo)
87
-
88
- * bug fix
89
- * Do not redirect when accessing devise API via JSON. (by @sebastianwr)
90
- * Generating scoped devise views now uses the correct scoped shared links partial instead of the default devise one (by @nashby)
91
- * Fix inheriting mailer templates from `Devise::Mailer`
92
- * Fix a bug when procs are used as default mailer in Devise (by @tomasv)
93
-
94
- ### 2.2.3
95
-
96
- Security announcement: http://blog.plataformatec.com.br/2013/01/security-announcement-devise-v2-2-3-v2-1-3-v2-0-5-and-v1-5-3-released/
97
-
98
- * bug fix
99
- * Require string conversion for all values
100
-
101
- ### 2.2.2
102
-
103
- * bug fix
104
- * Fix bug when checking for reconfirmable in templates
105
-
106
- ### 2.2.1
107
-
108
- * bug fix
109
- * Fix regression with case_insensitive_keys
110
- * Fix regression when password is blank when it is invalid
111
-
112
- ### 2.2.0
113
-
114
- * backwards incompatible changes
115
- * `headers_for` is deprecated, customize the mailer directly instead
116
- * All mailer methods now expect a second argument with delivery options
117
- * Default minimum password length is now 8 (by @carlosgaldino)
118
- * Support alternate sign in error message when email record does not exist (this adds a new I18n key to the locale file) (by @gabetax)
119
- * DeviseController responds only to HTML requests by default (call `DeviseController.respond_to` or `ApplicationController.respond_to` to add new formats)
120
- * Support Mongoid 3 onwards (by @durran)
121
-
122
- * enhancements
123
- * Fix unlockable which could leak account existence on paranoid mode (by @latortuga)
124
- * Confirmable now has a confirm_within option to set a period while the confirmation token is still valid (by @promisedlandt)
125
- * Flash messages in controller now respects `resource_name` (by @latortuga)
126
- * Separate `sign_in` and `sign_up` on RegistrationsController (by @rubynortheast)
127
- * Add autofocus to default views (by @Radagaisus)
128
- * Unlock user on password reset (by @marcinb)
129
- * Allow validation callbacks to apply to virtual attributes (by @latortuga)
130
-
131
- * bug fix
132
- * unconfirmed_email now uses the proper e-mail on salutation
133
- * Fix default email_regexp config to not allow spaces (by @kukula)
134
- * Fix a regression introduced on warden 1.2.1 (by @ejfinneran)
135
- * Properly camelize omniauth strategies (by @saizai)
136
- * Do not set flash messages for non navigational requests on session sign out (by @mathieul)
137
- * Set the proper fields as required on the lockable module (by @nickhoffman)
138
- * Respects Devise mailer default's reply_to (by @mrchrisadams)
139
- * Properly assign resource on `sign_in` related action (by @adammcnamara)
140
- * `update_with_password` doesn't change encrypted password when it is invalid (by @nashby)
141
- * Properly handle namespaced models on Active Record generator (by @nashby)
142
-
143
- ### 2.1.2
144
-
145
- * enhancements
146
- * Handle backwards incompatibility between Rails 3.2.6 and Thor 0.15.x
147
-
148
- * bug fix
149
- * Fix regression on strategy validation on previous release
150
-
151
- ### 2.1.1 (yanked)
152
-
153
- * enhancements
154
- * `sign_out_all_scopes` now locks warden and does not allow new logins in the same action
155
- * `Devise.omniauth_path_prefix` is available to configure omniauth path prefix
156
- * Redirect to sign in page when trying to access password#edit without a token (by @gbataille)
157
- * Allow a lambda in authenticate(d) routes helpers to further select the scope
158
- * Removed warnings on Rails 3.2.6 (by @nashby)
159
-
160
- * bug fix
161
- * `update_with_password` now relies on assign_attributes and forwards the :as option (by @wtn)
162
- * Do not trigger timeout on sign in related actions
163
- * Timeout does not explode when reset_authentication_token! is accidentally defined by Active Model (by @remomueller)
164
-
165
- * deprecations
166
- * Strategy#validate() no longer validates nil resources
167
-
168
- ### 2.1.0
169
-
170
- * enhancements
171
- * Add `check_fields!(model_class)` method on Devise::Models to check if the model includes the fields that Devise uses
172
- * Add `skip_reconfirmation!` to skip reconfirmation
173
- * Devise model generator now works with engines
174
- * Devise encryptable was moved to its new gem (http://github.com/plataformatec/devise-encryptable)
175
-
176
- * deprecations
177
- * Deprecations warnings added on Devise 2.0 are now removed with their features
178
- * All devise modules should now have a `required_fields(klass)` module method to help gathering missing attributes
179
- * `use_salt_as_remember_token` and `apply_schema` does not have any effect since 2.0 and are now deprecated
180
- * `valid_for_authentication?` must now return a boolean
181
-
182
- * bug fix
183
- * Ensure after sign in hook is not called without a resource
184
- * Fix a term: now on Omniauth related flash messages, we say that we're authenticating from an omniauth provider instead of authorizing
185
- * Fixed redirect when authenticated mounted apps (by @hakanensari)
186
- * Ensure the failure app still respects config.relative_url_root
187
- * `/users/sign_in` doesn't choke on protected attributes used to select sign in scope (by @Paymium)
188
- * `failed_attempts` is set to zero after any sign in (including via reset password) (by @rodrigoflores)
189
- * Added token expiration on timeout (by @antiarchitect)
190
- * Do not accidentally mark `_prefixes` as private
191
- * Better support for custom strategies on test helpers (by @mattconnolly)
192
- * Return `head :no_content` in SessionsController now that most JS libraries handle it (by @julianvargasalvarez)
193
- * Reverted moving devise/shared/_links.erb to devise/_links.erb
194
-
195
- ### 2.0.4
196
-
197
- Notes: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0
198
-
199
- * bug fix
200
- * Fix when :host is used with devise_for (by @mreinsch)
201
- * Fix a regression that caused Warden to be initialized too late
202
-
203
- ### 2.0.3 (yanked)
204
-
205
- * bug fix
206
- * Ensure warning is not shown by mistake on apps with mounted engines
207
- * Fixes related to remember_token and rememberable_options
208
- * Ensure serializable_hash does not depend on accessible attributes
209
- * Ensure that timeout callback does not run on sign out action
210
-
211
- ### 2.0.2
212
-
213
- * enhancements
214
- * Add devise_i18n_options to customize I18n message
215
-
216
- * bug fix
217
- * Ensure Devise.available_router_name defaults to :main_app
218
- * Set autocomplete to off for password on edit forms
219
- * Better error messages in case a trackable model can't be saved
220
- * Show a warning in case someone gives a pluralized name to devise generator
221
- * Fix test behavior for rspec subject requests (by @sj26)
222
-
223
- ### 2.0.1
224
-
225
- * enhancements
226
- * Improved error messages on deprecation warnings
227
- * Hide Devise's internal generators from `rails g` command
228
-
229
- * bug fix
230
- * Removed tmp and log files from gem
231
-
232
- ### 2.0.0
233
-
234
- * enhancements
235
- * Add support for e-mail reconfirmation on change (by @Mandaryn and @heimidal)
236
- * Redirect users to sign in page after unlock (by @nashby)
237
- * Redirect to the previous URL on timeout
238
- * Inherit from the same Devise parent controller (by @sj26)
239
- * Allow parent_controller to be customizable via Devise.parent_controller, useful for engines
240
- * Allow router_name to be customizable via Devise.router_name, useful for engines
241
- * Allow alternate ORMs to run compatibility setup code before Authenticatable is included (by @jm81)
242
-
243
- * deprecation
244
- * Devise now only supports Rails 3.1 forward
245
- * Devise.confirm_within was deprecated in favor Devise.allow_unconfirmed_access_for
246
- * Devise.stateless_token= is deprecated in favor of appending :token_auth to Devise.skip_session_storage
247
- * Usage of Devise.apply_schema is deprecated
248
- * Usage of Devise migration helpers are deprecated
249
- * Usage of Devise.remember_across_browsers was deprecated
250
- * Usage of rememberable with remember_token was removed
251
- * Usage of recoverable without reset_password_sent_at was removed
252
- * Usage of Devise.case_insensitive_keys equals to false was removed
253
- * Move devise/shared/_links.erb to devise/_links.erb
254
- * Deprecated support of nested devise_for blocks
255
- * Deprecated support to devise.registrations.reasons and devise.registrations.inactive_signed_up in favor of devise.registrations.signed_up_but_*
256
- * Protected method render_with_scope was removed.
257
-
258
- ### 1.5.3
259
-
260
- * bug fix
261
- * Ensure delegator converts scope to symbol (by @dmitriy-kiriyenko)
262
- * Ensure passing :format => false to devise_for is not permanent
263
- * Ensure path checker does not check invalid routes
264
-
265
- ### 1.5.2
266
-
267
- * enhancements
268
- * Add support for Rails 3.1 new mass assignment conventions (by @kirs)
269
- * Add timeout_in method to Timeoutable, it can be overridden in a model (by @lest)
270
-
271
- * bug fix
272
- * OmniAuth error message now shows the proper option (:strategy_class instead of :klass)
273
-
274
- ### 1.5.1
275
-
276
- * bug fix
277
- * Devise should not attempt to load OmniAuth strategies. Strategies should be loaded before hand by the developer or explicitly given to Devise.
278
-
279
- ### 1.5.0
280
-
281
- * enhancements
282
- * Timeoutable also skips tracking if skip_trackable is given
283
- * devise_for now accepts :failure_app as an option
284
- * Models can select the proper mailer via devise_mailer method (by @locomotivecms)
285
- * Migration generator now uses the change method (by @nashby)
286
- * Support to markerb templates on the mailer generator (by @sbounmy)
287
- * Support for Omniauth 1.0 (older versions are no longer supported) (by @TamiasSibiricus)
288
-
289
- * bug fix
290
- * Allow idempotent API requests
291
- * Fix bug where logs did not show 401 as status code
292
- * Change paranoid settings to behave as success instead of as failure
293
- * Fix bug where activation messages were shown first than the credentials error message
294
- * Instance variables are expired after sign out
295
-
296
- * deprecation
297
- * redirect_location is deprecated, please use after_sign_in_path_for
298
- * after_sign_in_path_for now redirects to session[scope_return_to] if any value is stored in it
299
-
300
- ### 1.4.9
301
-
302
- * bug fix
303
- * url helpers were not being set under some circumstances
304
-
305
- ### 1.4.8
306
-
307
- * enhancements
308
- * Add docs for assets pipeline and Heroku
309
-
310
- * bug fix
311
- * confirmation_url was not being set under some circumstances
312
-
313
- ### 1.4.7
314
-
315
- * bug fix
316
- * Fix backward incompatible change from 1.4.6 for those using custom controllers
317
-
318
- ### 1.4.6 (yanked)
319
-
320
- * enhancements
321
- * Allow devise_for :skip => :all
322
- * Allow options to be passed to authenticate_user!
323
- * Allow --skip-routes to devise generator
324
- * Add allow_params_authentication! to make it explicit when params authentication is allowed in a controller
325
-
326
- ### 1.4.5
327
-
328
- * bug fix
329
- * Failure app tries the root path if a session one does not exist
330
- * No need to finalize Devise helpers all the time (by @bradleypriest)
331
- * Reset password shows proper message if user is not active
332
- * `clean_up_passwords` sets the accessors to nil to skip validations
333
-
334
- ### 1.4.4
335
-
336
- * bug fix
337
- * Do not always skip helpers, instead provide :skip_helpers as option to trigger it manually
338
-
339
- ### 1.4.3
340
-
341
- * enhancements
342
- * Improve Rails 3.1 compatibility
343
- * Use serialize_into_session and serialize_from_session in Warden serialize to improve extensibility
344
-
345
- * bug fix
346
- * Generator properly generates a change_table migration if a model already exists
347
- * Properly deprecate setup_mail
348
- * Fix encoding issues with email regexp
349
- * Only generate helpers for the used mappings
350
- * Wrap :action constraints in the proper hash
351
-
352
- * deprecations
353
- * Loosened the used email regexp to simply assert the existent of "@". If someone relies on a more strict regexp, they may use https://github.com/SixArm/sixarm_ruby_email_address_validation
354
-
355
- ### 1.4.2
356
-
357
- * bug fix
358
- * Provide a more robust behavior to serializers and add :force_except option
359
-
360
- ### 1.4.1
361
-
362
- * enhancements
363
- * Add :defaults and :format support on router
364
- * Add simple form generators
365
- * Better localization for devise_error_messages! (by @zedtux)
366
-
367
- * bug fix
368
- * Ensure to_xml is properly white listened
369
- * Ensure handle_unverified_request clean up any cached signed-in user
370
-
371
- ### 1.4.0
372
-
373
- * enhancements
374
- * Added authenticated and unauthenticated to the router to route the used based on his status (by @sj26)
375
- * Improve e-mail regexp (by @rodrigoflores)
376
- * Add strip_whitespace_keys and default to e-mail (by @swrobel)
377
- * Do not run format and uniqueness validations on e-mail if it hasn't changed (by @Thibaut)
378
- * Added update_without_password to update models but not allowing the password to change (by @fschwahn)
379
- * Added config.paranoid, check the generator for more information (by @rodrigoflores)
380
-
381
- * bug fix
382
- * password_required? should not affect length validation
383
- * User cannot access sign up and similar pages if he is already signed in through a cookie or token
384
- * Do not convert booleans to strings on finders (by @xavier)
385
- * Run validations even if current_password fails (by @crx)
386
- * Devise now honors routes constraints (by @macmartine)
387
- * Do not return the user resource when requesting instructions (by @rodrigoflores)
388
-
389
- ### 1.3.4
390
-
391
- * bug fix
392
- * Do not add formats if html or "*/*"
393
-
394
- ### 1.3.3
395
-
396
- * bug fix
397
- * Explicitly mark the token as expired if so
398
-
399
- ### 1.3.2
400
-
401
- * bug fix
402
- * Fix another regression related to reset_password_sent_at (by @alexdreher)
403
-
404
- ### 1.3.1
405
-
406
- * enhancements
407
- * Improve failure_app responses (by @indirect)
408
- * sessions/new and registrations/new also respond to xml and json now
409
-
410
- * bug fix
411
- * Fix a regression that occurred if reset_password_sent_at is not present (by @stevehodgkiss)
412
-
413
- ### 1.3.0
414
-
415
- * enhancements
416
- * All controllers can now handle different mime types than html using Responders (by @sikachu)
417
- * Added reset_password_within as configuration option to send the token for recovery (by @jdguyot)
418
- * Bump password length to 128 characters (by @k33l0r)
419
- * Add :only as option to devise_for (by @timoschilling)
420
- * Allow to override path after sending password instructions (by @irohiroki)
421
- * require_no_authentication has its own flash message (by @jackdempsey)
422
-
423
- * bug fix
424
- * Fix a bug where configuration options were being included too late
425
- * Ensure Devise::TestHelpers can be used to tests Devise internal controllers (by @jwilger)
426
- * valid_password? should not choke on empty passwords (by @mikel)
427
- * Calling devise more than once does not include previously added modules anymore
428
- * downcase_keys before validation
429
-
430
- * backward incompatible changes
431
- * authentication_keys are no longer considered when creating the e-mail validations, the previous behavior was buggy. You must double check if you were relying on such behavior.
432
-
433
- ### 1.2.1
434
-
435
- * enhancements
436
- * Improve update path messages
437
-
438
- ### 1.2.0
439
-
440
- * bug fix
441
- * Properly ignore path prefix on omniauthable
442
- * Faster uniqueness queries
443
- * Rename active? to active_for_authentication? to avoid conflicts
444
-
445
- ### 1.2.rc2
446
-
447
- * enhancements
448
- * Make friendly_token 20 chars long
449
- * Use secure_compare
450
-
451
- * bug fix
452
- * Fix an issue causing infinite redirects in production
453
- * rails g destroy works properly with devise generators (by @andmej)
454
- * before_failure callbacks should work on test helpers (by @twinge)
455
- * rememberable cookie now is httponly by default (by @JamesFerguson)
456
- * Add missing confirmation_keys (by @JohnPlummer)
457
- * Ensure after_* hooks are called on RegistrationsController
458
- * When using database_authenticatable Devise will now only create an email field when appropriate (if using default authentication_keys or custom authentication_keys with email included)
459
- * Ensure stateless token does not trigger timeout (by @pixelauthority)
460
- * Implement handle_unverified_request for Rails 3.0.4 compatibility and improve FailureApp reliance on symbols
461
- * Consider namespaces while generating routes
462
- * Custom failure apps no longer ignored in test mode (by @jaghion)
463
- * Do not depend on ActiveModel::Dirty
464
- * Manual sign_in now triggers remember token
465
- * Be sure to halt strategies on failures
466
- * Consider SCRIPT_NAME on Omniauth paths
467
- * Reset failed attempts when lock is expired
468
- * Ensure there is no Mongoid injection
469
-
470
- * deprecations
471
- * Deprecated anybody_signed_in? in favor of signed_in? (by @gavinhughes)
472
- * Removed --haml and --slim view templates
473
- * Devise::OmniAuth helpers were deprecated and removed in favor of Omniauth.config.test_mode
474
-
475
- ### 1.2.rc
476
-
477
- * deprecations
478
- * cookie_domain is deprecated in favor of cookie_options
479
- * after_update_path_for can no longer be defined in ApplicationController
3
+ ### 4.7.1 - 2019-09-06
480
4
 
481
- * enhancements
482
- * Added OmniAuth support
483
- * Added ORM adapter to abstract ORM iteraction
484
- * sign_out_via is available in the router to configure the method used for sign out (by @martinrehfeld)
485
- * Improved Ajax requests handling in failure app (by @spastorino)
486
- * Added request_keys to easily use request specific values (like subdomain) in authentication
487
- * Increased the size of friendly_token to 60 characters (reduces the chances of a successful brute attack)
488
- * Ensure the friendly token does not include "_" or "-" since some e-mails may not autolink it properly (by @rymai)
489
- * Extracted encryptors into :encryptable for better bcrypt support
490
- * :rememberable is now able to use salt as token if no remember_token is provided
491
- * Store the salt in session and expire the session if the user changes his password
492
- * Allow :stateless_token to be set to true avoiding users to be stored in session through token authentication
493
- * cookie_options uses session_options values by default
494
- * Sign up now check if the user is active or not and redirect him accordingly setting the inactive_signed_up message
495
- * Use ActiveModel#to_key instead of #id
496
- * sign_out_all_scopes now destroys the whole session
497
- * Added case_insensitive_keys that automatically downcases the given keys, by default downcases only e-mail (by @adahl)
498
-
499
- * default behavior changes
500
- * sign_out_all_scopes defaults to true as security measure
501
- * http authenticatable is disabled by default
502
- * Devise does not intercept 401 returned from applications
503
-
504
- * bugfix
505
- * after_sign_in_path_for always receives a resource
506
- * Do not execute Warden::Callbacks on Devise::TestHelpers (by @sgronblo)
507
- * Allow password recovery and account unlocking to change used keys (by @RStankov)
508
- * FailureApp now properly handles nil request.format
509
- * Fix a bug causing FailureApp to return with HTTP Auth Headers for IE7
510
- * Ensure namespaces has proper scoped views
511
- * Ensure Devise does not set empty flash messages (by @sxross)
512
-
513
- ### 1.1.6
514
-
515
- * Use a more secure e-mail regexp
516
- * Implement Rails 3.0.4 handle unverified request
517
- * Use secure_compare to compare passwords
518
-
519
- ### 1.1.5
520
-
521
- * bugfix
522
- * Ensure to convert keys on indifferent hash
523
-
524
- * defaults
525
- * Set config.http_authenticatable to false to avoid confusion
526
-
527
- ### 1.1.4
528
-
529
- * bugfix
530
- * Avoid session fixation attacks
531
-
532
- ### 1.1.3
533
-
534
- * bugfix
535
- * Add reply-to to e-mail headers by default
536
- * Updated the views generator to respect the rails :template_engine option (by @fredwu)
537
- * Check the type of HTTP Authentication before using Basic headers
538
- * Avoid invalid_salt errors by checking salt presence (by @thibaudgg)
539
- * Forget user deletes the right cookie before logout, not remembering the user anymore (by @emtrane)
540
- * Fix for failed first-ever logins on PostgreSQL where column default is nil (by @bensie)
541
- * :default options is now honored in migrations
542
-
543
- ### 1.1.2
544
-
545
- * bugfix
546
- * Compatibility with latest Rails routes schema
547
-
548
- ### 1.1.1
549
-
550
- * bugfix
551
- * Fix a small bug where generated locale file was empty on devise:install
552
-
553
- ### 1.1.0
554
-
555
- * enhancements
556
- * Rememberable module allows user to be remembered across browsers and is enabled by default (by @trevorturk)
557
- * Rememberable module allows you to activate the period the remember me token is extended (by @trevorturk)
558
- * devise_for can now be used together with scope method in routes but with a few limitations (check the documentation)
559
- * Support `as` or `devise_scope` in the router to specify controller access scope
560
- * HTTP Basic Auth can now be disabled/enabled for xhr(ajax) requests using http_authenticatable_on_xhr option (by @pellja)
561
-
562
- * bug fix
563
- * Fix a bug in Devise::TestHelpers where current_user was returning a Response object for non active accounts
564
- * Devise should respect script_name and path_info contracts
565
- * Fix a bug when accessing a path with (.:format) (by @klacointe)
566
- * Do not add unlock routes unless unlock strategy is email or both
567
- * Email should be case insensitive
568
- * Store classes as string in session, to avoid serialization and stale data issues
569
-
570
- * deprecations
571
- * use_default_scope is deprecated and has no effect. Use :as or :devise_scope in the router instead
5
+ * bug fixes
6
+ * Fix an edge case where records with a blank `confirmation_token` could be confirmed (by @tegon)
7
+ * Fix typo inside `update_needs_confirmation` i18n key (by @lslm)
572
8
 
573
- ### 1.1.rc2
9
+ ### 4.7.0 - 2019-08-19
574
10
 
575
11
  * enhancements
576
- * Allow to set cookie domain for the remember token. (by @mantas)
577
- * Added navigational formats to specify when it should return a 302 and when a 401.
578
- * Added authenticate(scope) support in routes (by @wildchild)
579
- * Added after_update_path_for to registrations controller (by @thedelchop)
580
- * Allow the mailer object to be replaced through config.mailer = "MyOwnMailer"
12
+ * Support Rails 6.0
13
+ * Update CI to rails 6.0.0.beta3 (by @tunnes)
14
+ * refactor method name to be more consistent (by @saiqulhaq)
15
+ * Fix rails 6.0.rc1 email uniqueness validation deprecation warning (by @Vasfed)
581
16
 
582
- * bug fix
583
- * Fix a bug where session was timing out on sign out
17
+ * bug fixes
18
+ * Add `autocomplete="new-password"` to `password_confirmation` fields (by @ferrl)
19
+ * Fix rails_51_and_up? method for Rails 6.rc1 (by @igorkasyanchuk)
584
20
 
585
- * deprecations
586
- * bcrypt is now the default encryptor
587
- * devise.mailer.confirmations_instructions now should be devise.mailer.confirmations_instructions.subject
588
- * devise.mailer.user.confirmations_instructions now should be devise.mailer.confirmations_instructions.user_subject
589
- * Generators now use Rails 3 syntax (devise:install) instead of devise_install
21
+ ### 4.6.2 - 2019-03-26
590
22
 
591
- ### 1.1.rc1
23
+ * bug fixes
24
+ * Revert "Set `encrypted_password` to `nil` when `password` is set to `nil`" since it broke backward compatibility with existing applications. See more on https://github.com/plataformatec/devise/issues/5033#issuecomment-476386275 (by @mracos)
592
25
 
593
- * enhancements
594
- * Rails 3 compatibility
595
- * All controllers and views are namespaced, for example: Devise::SessionsController and "devise/sessions"
596
- * Devise.orm is deprecated. This reduces the required API to hook your ORM with devise
597
- * Use metal for failure app
598
- * HTML e-mails now have proper formatting
599
- * Allow to give :skip and :controllers in routes
600
- * Move trackable logic to the model
601
- * E-mails now use any template available in the filesystem. Easy to create multipart e-mails
602
- * E-mails asks headers_for in the model to set the proper headers
603
- * Allow to specify haml in devise_views
604
- * Compatibility with Mongoid
605
- * Make config.devise available on config/application.rb
606
- * TokenAuthenticatable now works with HTTP Basic Auth
607
- * Allow :unlock_strategy to be :none and add :lock_strategy which can be :failed_attempts or none. Setting those values to :none means that you want to handle lock and unlocking by yourself
608
- * No need to append ?unauthenticated=true in URLs anymore since Flash was moved to a middleware in Rails 3
609
- * :activatable is included by default in your models
610
-
611
- * bug fix
612
- * Fix a bug with STI
26
+ ### 4.6.1 - 2019-02-11
613
27
 
614
- * deprecations
615
- * Rails 3 compatible only
616
- * Removed support for MongoMapper
617
- * Scoped views are no longer "sessions/users/new". Now use "users/sessions/new"
618
- * Devise.orm is deprecated, just require "devise/orm/YOUR_ORM" instead
619
- * Devise.default_url_options is deprecated, just modify ApplicationController.default_url_options
620
- * All messages under devise.sessions, except :signed_in and :signed_out, should be moved to devise.failure
621
- * :as and :scope in routes is deprecated. Use :path and :singular instead
28
+ * bug fixes
29
+ * Check if `root_path` is defined with `#respond_to?` instead of `#present` (by @tegon)
622
30
 
623
- ### 1.0.8
31
+ ### 4.6.0 - 2019-02-07
624
32
 
625
33
  * enhancements
626
- * Support for latest MongoMapper
627
- * Added anybody_signed_in? helper (by @SSDany)
628
-
629
- * bug fix
630
- * confirmation_required? is properly honored on active? calls. (by @paulrosania)
34
+ * Allow to skip email and password change notifications (by @iorme1)
35
+ * Include the use of `nil` for `allow_unconfirmed_access_for` in the docs (by @joaumg)
36
+ * Ignore useless files into the `.gem` file (by @huacnlee)
37
+ * Explain the code that prevents enumeration attacks inside `Devise::Strategies::DatabaseAuthenticatable` (by @tegon)
38
+ * Refactor the `devise_error_messages!` helper to render a partial (by @prograhamer)
39
+ * Add an option (`Devise.sign_in_after_change_password`) to not automatically sign in a user after changing a password (by @knjko)
631
40
 
632
- ### 1.0.7
41
+ * bug fixes
42
+ * Fix missing comma in Simple Form generator (by @colinross)
43
+ * Fix error with migration generator in Rails 6 (by @oystersauce8)
44
+ * Set `encrypted_password` to `nil` when `password` is set to `nil` (by @sivagollapalli)
45
+ * Consider whether the request supports flash messages inside `Devise::Controllers::Helpers#is_flashing_format?` (by @colinross)
46
+ * Fix typo inside `Devise::Generators::ControllersGenerator` (by @kopylovvlad)
47
+ * Sanitize parameters inside `Devise::Models::Authenticatable#find_or_initialize_with_errors` (by @rlue)
48
+ * `#after_database_authentication` callback was not called after authentication on password reset (by @kanmaniselvan)
49
+ * Fix corner case when `#confirmation_period_valid?` was called at the same second as `confirmation_sent_at` was set. Mostly true for date types that only have second precisions. (by @stanhu)
50
+ * Fix unclosed `li` tag in `error_messages` partial (by @mracos)
51
+ * Fix Routes issue when devise engine is mounted in another engine on Rails versions lower than 5.1 (by @a-barbieri)
52
+ * Make `#increment_failed_attempts` concurrency safe (by @tegon)
53
+ * Apply Test Helper fix to Rails 6.0 as well as 5.x (by @matthewrudy)
633
54
 
634
- * bug fix
635
- * Ensure password confirmation is always required
636
55
 
637
56
  * deprecations
638
- * authenticatable was deprecated and renamed to database_authenticatable
639
- * confirmable is not included by default on generation
640
-
641
- ### 1.0.6
642
-
643
- * bug fix
644
- * Do not allow unlockable strategies based on time to access a controller.
645
- * Do not send unlockable email several times.
646
- * Allow controller to upstram custom! failures to Warden.
647
-
648
- ### 1.0.5
649
-
650
- * bug fix
651
- * Use prepend_before_filter in require_no_authentication.
652
- * require_no_authentication on unlockable.
653
- * Fix a bug when giving an association proxy to devise.
654
- * Do not use lock! on lockable since it's part of ActiveRecord API.
655
-
656
- ### 1.0.4
657
-
658
- * bug fix
659
- * Fixed a bug when deleting an account with rememberable
660
- * Fixed a bug with custom controllers
661
-
662
- ### 1.0.3
663
-
664
- * enhancements
665
- * HTML e-mails now have proper formatting
666
- * Do not remove MongoMapper options in find
667
-
668
- ### 1.0.2
669
-
670
- * enhancements
671
- * Allows you set mailer content type (by @glennr)
672
-
673
- * bug fix
674
- * Uses the same content type as request on http authenticatable 401 responses
675
-
676
- ### 1.0.1
677
-
678
- * enhancements
679
- * HttpAuthenticatable is not added by default automatically.
680
- * Avoid mass assignment error messages with current password.
681
-
682
- * bug fix
683
- * Fixed encryptors autoload
684
-
685
- ### 1.0.0
686
-
687
- * deprecation
688
- * :old_password in update_with_password is deprecated, use :current_password instead
57
+ * The second argument of `DatabaseAuthenticatable`'s `#update_with_password` and `#update_without_password` is deprecated and will be removed in the next major version. It was added to support a feature deprecated in Rails 4, so you can safely remove it from your code. (by @ihatov08)
58
+ * The `DeviseHelper.devise_error_messages!` is deprecated and will be removed in the next major version. Use the `devise/shared/error_messages` partial instead. (by @mracos)
689
59
 
690
- * enhancements
691
- * Added Registerable
692
- * Added Http Basic Authentication support
693
- * Allow scoped_views to be customized per controller/mailer class
694
- * Allow authenticatable to used in change_table statements
695
-
696
- ### 0.9.2
697
-
698
- * bug fix
699
- * Ensure inactive user cannot sign in
700
- * Ensure redirect to proper url after sign up
701
-
702
- * enhancements
703
- * Added gemspec to repo
704
- * Added token authenticatable (by @grimen)
705
-
706
- ### 0.9.1
707
-
708
- * bug fix
709
- * Allow bigger salt size (by @jgeiger)
710
- * Fix relative url root
711
-
712
- ### 0.9.0
713
-
714
- * deprecation
715
- * devise :all is deprecated
716
- * :success and :failure flash messages are now :notice and :alert
717
-
718
- * enhancements
719
- * Added devise lockable (by @mhfs)
720
- * Warden 0.9.0 compatibility
721
- * Mongomapper 0.6.10 compatibility
722
- * Added Devise.add_module as hooks for extensions (by @grimen)
723
- * Ruby 1.9.1 compatibility (by @grimen)
724
-
725
- * bug fix
726
- * Accept path prefix not starting with slash
727
- * url helpers should rely on find_scope!
728
-
729
- ### 0.8.2
730
-
731
- * enhancements
732
- * Allow Devise.mailer_sender to be a proc (by @grimen)
733
-
734
- * bug fix
735
- * Fix bug with passenger, update is required to anyone deploying on passenger (by @dvdpalm)
736
-
737
- ### 0.8.1
60
+ ### 4.5.0 - 2018-08-15
738
61
 
739
62
  * enhancements
740
- * Move salt to encryptors
741
- * Devise::Lockable
742
- * Moved view links into partial and I18n'ed them
63
+ * Use `before_action` instead of `before_filter` (by @edenthecat)
64
+ * Allow people to extend devise failure app, through invoking `ActiveSupport.run_load_hooks` once `Devise::FailureApp` is loaded (by @wnm)
65
+ * Use `update` instead of `update_attributes` (by @koic)
66
+ * Split IP resolution from `update_tracked_fields` (by @mckramer)
67
+ * upgrade dependencies for rails and responders (by @lancecarlson)
68
+ * Add `autocomplete="new-password"` to new password fields (by @gssbzn)
69
+ * Add `autocomplete="current-password"` to current password fields (by @gssbzn)
70
+ * Remove redundant `self` from `database_authenticatable` module (by @abhishekkanojia)
71
+ * Update `simple_form` templates with changes from https://github.com/plataformatec/devise/commit/16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and https://github.com/plataformatec/devise/commit/6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn)
72
+ * Remove `:trackable` from the default modules in the generators, to be more GDPR-friendly (by @fakenine)
743
73
 
744
- * bug fix
745
- * Bcrypt generator was not being loaded neither setting the proper salt
746
-
747
- ### 0.8.0
748
-
749
- * enhancements
750
- * Warden 0.8.0 compatibility
751
- * Add an easy for map.connect "sign_in", :controller => "sessions", :action => "new" to work
752
- * Added :bcrypt encryptor (by @capotej)
753
-
754
- * bug fix
755
- * sign_in_count is also increased when user signs in via password change, confirmation, etc..
756
- * More DataMapper compatibility (by @lancecarlson)
757
-
758
- * deprecation
759
- * Removed DeviseMailer.sender
760
-
761
- ### 0.7.5
762
-
763
- * enhancements
764
- * Set a default value for mailer to avoid find_template issues
765
- * Add models configuration to MongoMapper::EmbeddedDocument as well
766
-
767
- ### 0.7.4
74
+ * bug fixes
75
+ * Use same string on failed login regardless of whether account exists when in paranoid mode (by @TonyMK9068)
76
+ * Fix error when params is not a hash inside `Devise::ParameterSanitizer` (by @b0nn1e)
77
+ * Look for `secret_key_base` inside `Rails.application` (by @gencer)
78
+ * Ensure `Devise::ParameterFilter` does not add missing keys when called with a hash that has a `default` / `default_proc`
79
+ configured (by @joshpencheon)
80
+ * Adds `is_navigational_format?` check to `after_sign_up_path_for` to keep consistency (by @iorme1)
768
81
 
769
- * enhancements
770
- * Extract Activatable from Confirmable
771
- * Decouple Serializers from Devise modules
82
+ ### 4.4.3 - 2018-03-17
772
83
 
773
- ### 0.7.3
84
+ * bug fixes
85
+ * Fix undefined method `rails5?` for Devise::Test:Module (by @tegon)
86
+ * Fix: secret key was being required to be set inside credentials on Rails 5.2 (by @tegon)
774
87
 
775
- * bug fix
776
- * Give scope to the proper model validation
88
+ ### 4.4.2 - 2018-03-15
777
89
 
778
90
  * enhancements
779
- * Mail views are scoped as well
780
- * Added update_with_password for authenticatable
781
- * Allow render_with_scope to accept :controller option
91
+ * Support for :credentials on Rails v5.2.x. (by @gencer)
92
+ * Improve documentation about the test suite. (by @tegon)
93
+ * Test with Rails 5.2.rc1 on Travis. (by @jcoyne)
94
+ * Allow test with Rails 6. (by @Fudoshiki)
95
+ * Creating a new section for controller configuration on `devise.rb` template (by @Danilo-Araujo-Silva)
782
96
 
783
- ### 0.7.2
784
-
785
- * deprecation
786
- * Renamed reset_confirmation! to resend_confirmation!
787
- * Copying locale is part of the installation process
788
-
789
- * bug fix
790
- * Fixed render_with_scope to work with all controllers
791
- * Allow sign in with two different users in Devise::TestHelpers
792
-
793
- ### 0.7.1
97
+ * bug fixes
98
+ * Preserve content_type for unauthenticated tests (by @gmcnaughton)
99
+ * Check if the resource is persisted in `update_tracked_fields!` instead of performing validations (by @tegon)
100
+ * Revert "Replace log_process_action to append_info_to_payload" (by @tegon)
794
101
 
795
- * enhancements
796
- * Small enhancements for other plugins compatibility (by @grimen)
102
+ ### 4.4.1 - 2018-01-23
797
103
 
798
- ### 0.7.0
104
+ * bug fixes
105
+ * Ensure Gemspec is loaded as utf-8. (by @segiddins)
106
+ * Fix `ActiveRecord` check on `Confirmable`. (by @tegon)
107
+ * Fix `signed_in?` docs without running auth hooks. by (@machty)
799
108
 
800
- * deprecations
801
- * :authenticatable is not included by default anymore
109
+ ### 4.4.0 - 2017-12-29
802
110
 
803
111
  * enhancements
804
- * Improve loading process
805
- * Extract SessionSerializer from Authenticatable
806
-
807
- ### 0.6.3
808
-
809
- * bug fix
810
- * Added trackable to migrations
811
- * Allow inflections to work
112
+ * Add `frozen_string_literal` pragma comment to all Ruby files. (by @pat)
113
+ * Use `set_flash_method!` instead of `set_flash_method` in `Devise::OmniauthCallbacksController#failure`. (by @saichander17)
114
+ * Clarify how `store_location_for` modifies URIs. (by @olivierlacan)
115
+ * Move `failed_attempts` increment into its own function. by (@mobilutz)
116
+ * Add `autocomplete="email"` to email fields. by (@MikeRogers0)
117
+ * Add the ability to change the default migrations path introduced in Rails 5.0.3. (by @alexhifer)
118
+ * Delete unnecessary condition for helper method. (by @davydovanton)
119
+ * Support `id: :uuid` option for migrations. (by @filip373)
812
120
 
813
- ### 0.6.2
814
-
815
- * enhancements
816
- * More DataMapper compatibility
817
- * Devise::Trackable - track sign in count, timestamps and ips
121
+ * bug fixes
122
+ * Fix syntax for MRI 2.5.0. (by @pat)
123
+ * Validations were being ignored on singup in the `Trackable#update_tracked_fields!` method. (by @AshleyFoster)
124
+ * Do not modify options for `#serializable_hash`. (by @guigs)
125
+ * 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)
818
126
 
819
- ### 0.6.1
127
+ ### 4.3.0 - 2017-05-14
820
128
 
821
- * enhancements
822
- * Devise::Timeoutable - timeout sessions without activity
823
- * DataMapper now accepts conditions
129
+ * Enhancements
130
+ * Dependency support added for Rails 5.1.x.
824
131
 
825
- ### 0.6.0
132
+ ### 4.2.1 - 2017-03-15
826
133
 
134
+ * removals
135
+ * `Devise::Mailer#scope_name` and `Devise::Mailer#resource` are now protected
136
+ methods instead of public.
137
+ * bug fixes
138
+ * Attempt to reset password without the password field in the request now results in a `:blank` validation error.
139
+ Before this change, Devise would accept the reset password request and log the user in, without validating/changing
140
+ the password. (by @victor-am)
141
+ * Confirmation links now expire based on UTC time, working properly when using different timezones. (by @jjuliano)
142
+ * enhancements
143
+ * Notify the original email when it is changed with a new `Devise.send_email_changed_notification` setting.
144
+ When using `reconfirmable`, the notification will be sent right away instead of when the unconfirmed email is confirmed.
145
+ (original change by @ethirajsrinivasan)
146
+
147
+ ### 4.2.0 - 2016-07-01
148
+
149
+ * removals
150
+ * Remove the deprecated `Devise::ParameterSanitizer` API from Devise 3.
151
+ Please use the `#permit` and `#sanitize` methods over `#for`.
152
+ * Remove the deprecated OmniAuth URL helpers. Use the fully qualified helpers
153
+ (`user_facebook_omniauth_authorize_path`) over the scope based helpers
154
+ ( `user_omniauth_authorize_path(:facebook)`).
155
+ * Remove the `Devise.bcrypt` method, use `Devise::Encryptor.digest` instead.
156
+ * Remove the `Devise::Models::Confirmable#confirm!` method, use `confirm` instead.
157
+ * Remove the `Devise::Models::Recoverable#reset_password!` method, use `reset_password` instead.
158
+ * Remove the `Devise::Models::Recoverable#after_password_reset` method.
159
+ * bug fixes
160
+ * Fix an `ActionDispatch::IllegalStateError` when testing controllers with Rails 5 rc 2(by @hamadata).
161
+ * Use `ActiveSupport.on_load` hooks to include Devise on `ActiveRecord` and `Mongoid`,
162
+ avoiding autoloading these constants too soon (by @lucasmazza, @rafaelfranca).
163
+ * enhancements
164
+ * Display the minimum password length on `registrations/edit` view (by @Yanchek99).
165
+ * You can disable Devise's routes reloading on boot by through the `reload_routes = false` config.
166
+ This can reduce the time taken to boot the application but it might trigger
167
+ some errors if you application (mostly your controllers) requires that
168
+ Devise mappings be loaded during boot time (by @sidonath).
169
+ * Added `Devise::Test::IntegrationHelpers` to bypass the sign in process using
170
+ Warden test API (by @lucasmazza).
171
+ * Define `inspect` in `Devise::Models::Authenticatable` to help ensure password hashes
172
+ aren't included in exceptions or otherwise accidentally serialized (by @tkrajcar).
173
+ * Add missing support of `Rails.application.config.action_controller.relative_url_root` (by @kosdiamantis).
827
174
  * deprecations
828
- * :authenticatable is still included by default, but yields a deprecation warning
829
-
830
- * enhancements
831
- * Added DataMapper support
832
- * Remove store_location from authenticatable strategy and add it to failure app
833
- * Allow a strategy to be placed after authenticatable
834
- * Do not rely attribute? methods, since they are not added on Datamapper
175
+ * `Devise::TestHelpers` is deprecated in favor of `Devise::Test::ControllerHelpers`
176
+ (by @lucasmazza).
177
+ * The `sign_in` test helper has changed to use keyword arguments when passing
178
+ a scope. `sign_in :admin, users(:alice)` should be rewritten as
179
+ `sign_in users(:alice), scope: :admin` (by @lucasmazza).
180
+ * The option `bypass` of `Devise::Controllers::SignInOut#sign_in` method is
181
+ deprecated in favor of `Devise::Controllers::SignInOut#bypass_sign_in`
182
+ method (by @ulissesalmeida).
835
183
 
836
- ### 0.5.6
184
+ ### 4.1.1 - 2016-05-15
837
185
 
838
- * enhancements
839
- * Do not send nil to build (DataMapper compatibility)
840
- * Allow to have scoped views
841
-
842
- ### 0.5.5
843
-
844
- * enhancements
845
- * Allow overwriting find for authentication method
846
- * Remove Ruby 1.8.7 dependency
186
+ * bug fixes
187
+ * Fix overwriting the remember_token when a valid one already exists (by @ralinchimev).
847
188
 
848
- ### 0.5.4
189
+ ### 4.1.0
849
190
 
191
+ * bug fixes
192
+ * Fix race condition of sending the confirmation instructions e-mail using background jobs.
193
+ Using the previous `after_create` callback, the e-mail can be sent before
194
+ the record be committed on database, generating a `ActiveRecord::NotFound` error.
195
+ Now the confirmation e-mail will be only sent after the database commit,
196
+ using the `after_commit` callback.
197
+ It may break your test suite on Rails 4 if you are testing the sent e-mails
198
+ or enqueued jobs using transactional fixtures enabled or `DatabaseCleaner` with `transaction` strategy.
199
+ You can easily fix your test suite using the gem
200
+ [test_after_commit](https://github.com/grosser/test_after_commit). For example, put in your Gemfile:
201
+
202
+ ```ruby
203
+ gem 'test_after_commit', :group => :test
204
+ ```
205
+
206
+ On Rails 5 `after_commit` callbacks are triggered even using transactional
207
+ fixtures, then this fix will not break your test suite. If you are using `DatabaseCleaner` with the `deletion` or `truncation` strategies it may not break your tests. (by @allenwq)
208
+ * Fix strategy checking in `Lockable#unlock_strategy_enabled?` for `:none` and
209
+ `:undefined` strategies. (by @f3ndot)
210
+ * features
211
+ * Humanize authentication keys in failure flash message (by @byzg)
212
+ When you are configuring the translations of `devise.failure.invalid`, the
213
+ `authentication_keys` is translated now.
850
214
  * deprecations
851
- * Deprecate :singular in devise_for and use :scope instead
852
-
853
- * enhancements
854
- * Create after_sign_in_path_for and after_sign_out_path_for hooks to be
855
- overwriten in ApplicationController
856
- * Create sign_in_and_redirect and sign_out_and_redirect helpers
857
- * Warden::Manager.default_scope is automatically configured to the first given scope
858
-
859
- ### 0.5.3
860
-
861
- * bug fix
862
- * MongoMapper now converts DateTime to Time
863
- * Ensure all controllers are unloadable
864
-
865
- * enhancements
866
- * Moved friendly_token to Devise
867
- * Added Devise.all, so you can freeze your app strategies
868
- * Added Devise.apply_schema, so you can turn it to false in Datamapper or MongoMapper
869
- in cases you don't want it be handlded automatically
215
+ * Remove code supporting old session serialization format (by @fphilipe).
216
+ * Now the `email_regexp` default uses a more permissive regex:
217
+ `/\A[^@\s]+@[^@\s]+\z/` (by @kimgb)
218
+ * Now the `strip_whitespace_keys` default is `[:email]` (by @ulissesalmeida)
219
+ * Now the `reconfirmable` default is `true` (by @ulissesalmeida)
220
+ * Now the `skip_session_storage` default is `[:http_auth]` (by @ulissesalmeida)
221
+ * Now the `sign_out_via` default is `:delete` (by @ulissesalmeida)
222
+ * improvements
223
+ * Avoids extra computation of friendly token for confirmation token (by @sbc100)
870
224
 
871
- ### 0.5.2
225
+ ### 4.0.3 - 2016-05-15
872
226
 
873
- * enhancements
874
- * Improved sign_in and sign_out helpers to accepts resources
875
- * Added stored_location_for as a helper
876
- * Added test helpers
877
-
878
- ### 0.5.1
879
-
880
- * enhancements
881
- * Added serializers based on Warden ones
882
- * Allow authentication keys to be set
227
+ * bug fixes
228
+ * Fix overwriting the remember_token when a valid one already exists (by @ralinchimev).
883
229
 
884
- ### 0.5.0
230
+ ### 4.0.2 - 2016-05-02
885
231
 
886
- * bug fix
887
- * Fixed a bug where remember me module was not working properly
232
+ * bug fixes
233
+ * Fix strategy checking in `Lockable#unlock_strategy_enabled?` for `:none`
234
+ and `:undefined` strategies. (by @f3ndot)
888
235
 
889
- * enhancements
890
- * Moved encryption strategy into the Encryptors module to allow several algorithms (by @mhfs)
891
- * Implemented encryptors for Clearance, Authlogic and Restful-Authentication (by @mhfs)
892
- * Added support for MongoMapper (by @shingara)
236
+ ### 4.0.1 - 2016-04-25
893
237
 
894
- ### 0.4.3
238
+ * bug fixes
239
+ * Fix the e-mail confirmation instructions send when a user updates the email
240
+ address from nil. (by @lmduc)
241
+ * Remove unnecessary `attribute_will_change!` call. (by @cadejscroggins)
242
+ * Consistent `permit!` check. (by @ulissesalmeida)
895
243
 
896
- * bug fix
897
- * Authentication just fails if user cannot be serialized from session, without raising errors;
898
- * Default configuration values should not overwrite user values;
244
+ ### 4.0.0 - 2016-04-18
899
245
 
900
- ### 0.4.2
246
+ * bug fixes
247
+ * Fix the `extend_remember_period` configuration. When set to `false` it does
248
+ not update the cookie expiration anymore.(by @ulissesalmeida)
901
249
 
902
250
  * deprecations
903
- * Renamed mail_sender to mailer_sender
904
-
905
- * enhancements
906
- * skip_before_filter added in Devise controllers
907
- * Use home_or_root_path on require_no_authentication as well
908
- * Added devise_controller?, useful to select or reject filters in ApplicationController
909
- * Allow :path_prefix to be given to devise_for
910
- * Allow default_url_options to be configured through devise (:path_prefix => "/:locale" is now supported)
911
-
912
- ### 0.4.1
913
-
914
- * bug fix
915
- * Ensure options can be set even if models were not loaded
916
-
917
- ### 0.4.0
251
+ * Added a warning of default value change in Devise 4.1 for users that uses
252
+ the the default configuration of the following configurations: (by @ulissesalmeida)
253
+ * `strip_whitespace_keys` - The default will be `[:email]`.
254
+ * `skip_session_storage` - The default will be `[:http_auth]`.
255
+ * `sign_out_via` - The default will be `:delete`.
256
+ * `reconfirmable` - The default will be `true`.
257
+ * `email_regexp` - The default will be `/\A[^@\s]+@[^@\s]+\z/`.
258
+ * Removed deprecated argument of `Devise::Models::Rememberable#remember_me!` (by @ulissesalmeida)
259
+ * Removed deprecated private method Devise::Controllers::Helpers#expire_session_data_after_sign_in!
260
+ (by @bogdanvlviv)
261
+
262
+ ### 4.0.0.rc2 - 2016-03-09
263
+
264
+ * enhancements
265
+ * Introduced `DeviseController#set_flash_message!` for conditional flash
266
+ messages setting to reduce complexity.
267
+ * `rails g devise:install` will fail if the app does not have a ORM configured
268
+ (by @arjunsharma)
269
+ * Support to Rails 5 versioned migrations added.
918
270
 
919
271
  * deprecations
920
- * Notifier is deprecated, use DeviseMailer instead. Remember to rename
921
- app/views/notifier to app/views/devise_mailer and I18n key from
922
- devise.notifier to devise.mailer
923
- * :authenticable calls are deprecated, use :authenticatable instead
272
+ * omniauth routes are no longer defined with a wildcard `:provider` parameter,
273
+ and provider specific routes are defined instead, so route helpers like `user_omniauth_authorize_path(:github)` are deprecated in favor of `user_github_omniauth_authorize_path`.
274
+ You can still use `omniauth_authorize_path(:user, :github)` if you need to
275
+ call the helpers dynamically.
924
276
 
925
- * enhancements
926
- * Allow devise to be more agnostic and do not require ActiveRecord to be loaded
927
- * Allow Warden::Manager to be configured through Devise
928
- * Created a generator which creates an initializer
929
-
930
- ### 0.3.0
277
+ ### 4.0.0.rc1 - 2016-02-01
931
278
 
932
- * bug fix
933
- * Allow yml messages to be configured by not using engine locales
279
+ * Support added to Rails 5 (by @twalpole).
280
+ * Devise no longer supports Rails 3.2 and 4.0.
281
+ * Devise no longer supports Ruby 1.9 and 2.0.
934
282
 
935
283
  * deprecations
936
- * Renamed confirm_in to confirm_within
937
- * Do not send confirmation messages when user changes his e-mail
938
- * Renamed authenticable to authenticatable and added deprecation warnings
939
-
940
- ### 0.2.3
941
-
942
- * enhancements
943
- * Ensure fail! works inside strategies
944
- * Make unauthenticated message (when you haven't signed in) different from invalid message
945
-
946
- * bug fix
947
- * Do not redirect on invalid authenticate
948
- * Allow model configuration to be set to nil
949
-
950
- ### 0.2.2
951
-
952
- * bug fix
953
- * Fix a bug when using customized resources
954
-
955
- ### 0.2.1
956
-
957
- * refactor
958
- * Clean devise_views generator to use devise existing views
959
-
960
- * enhancements
961
- * Create instance variables (like @user) for each devise controller
962
- * Use Devise::Controller::Helpers only internally
963
-
964
- * bug fix
965
- * Fix a bug with Mongrel and Ruby 1.8.6
966
-
967
- ### 0.2.0
968
-
969
- * enhancements
970
- * Allow option :null => true in authenticable migration
971
- * Remove attr_accessible calls from devise modules
972
- * Customizable time frame for rememberable with :remember_for config
973
- * Customizable time frame for confirmable with :confirm_in config
974
- * Generators for creating a resource and copy views
975
-
976
- * optimize
977
- * Do not load hooks or strategies if they are not used
978
-
979
- * bug fixes
980
- * Fixed requiring devise strategies
981
-
982
- ### 0.1.1
983
-
984
- * bug fixes
985
- * Fixed requiring devise mapping
986
-
987
- ### 0.1.0
988
-
989
- * Devise::Authenticable
990
- * Devise::Confirmable
991
- * Devise::Recoverable
992
- * Devise::Validatable
993
- * Devise::Migratable
994
- * Devise::Rememberable
995
-
996
- * SessionsController
997
- * PasswordsController
998
- * ConfirmationsController
999
-
1000
- * Create an example app
1001
- * devise :all, :except => :rememberable
1002
- * Use sign_in and sign_out in SessionsController
1003
-
1004
- * Mailer subjects namespaced by model
1005
- * Allow stretches and pepper per model
1006
-
1007
- * Store session[:return_to] in session
1008
- * Sign user in automatically after confirming or changing it's password
284
+ * The `devise_parameter_sanitize` API has changed:
285
+ The `for` method was deprecated in favor of `permit`:
286
+
287
+ ```ruby
288
+ def configure_permitted_parameters
289
+ devise_parameter_sanitizer.for(:sign_up) << :subscribe_newsletter
290
+ # Should become the following.
291
+ devise_parameter_sanitizer.permit(:sign_up, keys: [:subscribe_newsletter])
292
+ end
293
+ ```
294
+
295
+ The customization through instance methods on the sanitizer implementation
296
+ should be done through it's `initialize` method:
297
+
298
+ ```ruby
299
+ class User::ParameterSanitizer < Devise::ParameterSanitizer
300
+ def sign_up
301
+ default_params.permit(:username, :email)
302
+ end
303
+ end
304
+
305
+ # The `sign_up` method can be a `permit` call on the sanitizer `initialize`.
306
+
307
+ class User::ParameterSanitizer < Devise::ParameterSanitizer
308
+ def initialize(*)
309
+ super
310
+ permit(:sign_up, keys: [:username, :email])
311
+ end
312
+ end
313
+ ```
314
+
315
+ You can check more examples and explanations on the [README section](README.md#strong-parameters)
316
+ and on the [ParameterSanitizer docs](lib/devise/parameter_sanitizer.rb).
317
+
318
+ Please check [3-stable](https://github.com/plataformatec/devise/blob/3-stable/CHANGELOG.md)
319
+ for previous changes.