devise 4.4.0 → 4.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +125 -4
  3. data/MIT-LICENSE +2 -1
  4. data/README.md +124 -58
  5. data/app/controllers/devise/passwords_controller.rb +1 -0
  6. data/app/controllers/devise/registrations_controller.rb +26 -8
  7. data/app/controllers/devise_controller.rb +3 -3
  8. data/app/helpers/devise_helper.rb +21 -18
  9. data/app/mailers/devise/mailer.rb +5 -5
  10. data/app/views/devise/confirmations/new.html.erb +1 -1
  11. data/app/views/devise/passwords/edit.html.erb +3 -3
  12. data/app/views/devise/passwords/new.html.erb +1 -1
  13. data/app/views/devise/registrations/edit.html.erb +4 -4
  14. data/app/views/devise/registrations/new.html.erb +3 -3
  15. data/app/views/devise/sessions/new.html.erb +3 -3
  16. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  17. data/app/views/devise/shared/_links.html.erb +7 -7
  18. data/app/views/devise/unlocks/new.html.erb +1 -1
  19. data/config/locales/en.yml +3 -2
  20. data/lib/devise.rb +5 -4
  21. data/lib/devise/controllers/helpers.rb +13 -13
  22. data/lib/devise/controllers/sign_in_out.rb +10 -4
  23. data/lib/devise/controllers/url_helpers.rb +1 -1
  24. data/lib/devise/failure_app.rb +25 -5
  25. data/lib/devise/hooks/timeoutable.rb +2 -2
  26. data/lib/devise/mapping.rb +1 -1
  27. data/lib/devise/models/authenticatable.rb +44 -45
  28. data/lib/devise/models/confirmable.rb +19 -4
  29. data/lib/devise/models/database_authenticatable.rb +50 -12
  30. data/lib/devise/models/lockable.rb +3 -3
  31. data/lib/devise/models/recoverable.rb +2 -2
  32. data/lib/devise/models/registerable.rb +2 -0
  33. data/lib/devise/models/rememberable.rb +1 -1
  34. data/lib/devise/models/trackable.rb +14 -2
  35. data/lib/devise/models/validatable.rb +1 -1
  36. data/lib/devise/parameter_filter.rb +2 -0
  37. data/lib/devise/parameter_sanitizer.rb +13 -1
  38. data/lib/devise/rails.rb +1 -5
  39. data/lib/devise/rails/routes.rb +6 -6
  40. data/lib/devise/secret_key_finder.rb +27 -0
  41. data/lib/devise/strategies/authenticatable.rb +1 -1
  42. data/lib/devise/strategies/database_authenticatable.rb +6 -1
  43. data/lib/devise/test/controller_helpers.rb +4 -1
  44. data/lib/devise/test/integration_helpers.rb +1 -1
  45. data/lib/devise/version.rb +1 -1
  46. data/lib/generators/active_record/devise_generator.rb +9 -9
  47. data/lib/generators/devise/controllers_generator.rb +1 -1
  48. data/lib/generators/devise/devise_generator.rb +1 -1
  49. data/lib/generators/devise/install_generator.rb +1 -5
  50. data/lib/generators/devise/orm_helpers.rb +2 -2
  51. data/lib/generators/devise/views_generator.rb +1 -1
  52. data/lib/generators/mongoid/devise_generator.rb +5 -5
  53. data/lib/generators/templates/README +9 -1
  54. data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +1 -1
  55. data/lib/generators/templates/devise.rb +37 -5
  56. data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
  57. data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +10 -2
  58. data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
  59. data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -3
  60. data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
  61. data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
  62. data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
  63. metadata +8 -308
  64. data/.gitignore +0 -10
  65. data/.travis.yml +0 -63
  66. data/.yardopts +0 -9
  67. data/CODE_OF_CONDUCT.md +0 -22
  68. data/CONTRIBUTING.md +0 -79
  69. data/Gemfile +0 -39
  70. data/Gemfile.lock +0 -193
  71. data/ISSUE_TEMPLATE.md +0 -19
  72. data/Rakefile +0 -37
  73. data/bin/test +0 -13
  74. data/devise.gemspec +0 -28
  75. data/devise.png +0 -0
  76. data/gemfiles/Gemfile.rails-4.1-stable +0 -32
  77. data/gemfiles/Gemfile.rails-4.1-stable.lock +0 -171
  78. data/gemfiles/Gemfile.rails-4.2-stable +0 -32
  79. data/gemfiles/Gemfile.rails-4.2-stable.lock +0 -192
  80. data/gemfiles/Gemfile.rails-5.0-stable +0 -33
  81. data/gemfiles/Gemfile.rails-5.0-stable.lock +0 -192
  82. data/guides/bug_report_templates/integration_test.rb +0 -106
  83. data/test/controllers/custom_registrations_controller_test.rb +0 -42
  84. data/test/controllers/custom_strategy_test.rb +0 -66
  85. data/test/controllers/helper_methods_test.rb +0 -24
  86. data/test/controllers/helpers_test.rb +0 -318
  87. data/test/controllers/inherited_controller_i18n_messages_test.rb +0 -53
  88. data/test/controllers/internal_helpers_test.rb +0 -129
  89. data/test/controllers/load_hooks_controller_test.rb +0 -21
  90. data/test/controllers/passwords_controller_test.rb +0 -34
  91. data/test/controllers/sessions_controller_test.rb +0 -108
  92. data/test/controllers/url_helpers_test.rb +0 -67
  93. data/test/delegator_test.rb +0 -21
  94. data/test/devise_test.rb +0 -109
  95. data/test/failure_app_test.rb +0 -340
  96. data/test/generators/active_record_generator_test.rb +0 -130
  97. data/test/generators/controllers_generator_test.rb +0 -50
  98. data/test/generators/devise_generator_test.rb +0 -41
  99. data/test/generators/install_generator_test.rb +0 -26
  100. data/test/generators/mongoid_generator_test.rb +0 -25
  101. data/test/generators/views_generator_test.rb +0 -105
  102. data/test/helpers/devise_helper_test.rb +0 -51
  103. data/test/integration/authenticatable_test.rb +0 -712
  104. data/test/integration/confirmable_test.rb +0 -326
  105. data/test/integration/database_authenticatable_test.rb +0 -97
  106. data/test/integration/http_authenticatable_test.rb +0 -108
  107. data/test/integration/lockable_test.rb +0 -242
  108. data/test/integration/mounted_engine_test.rb +0 -38
  109. data/test/integration/omniauthable_test.rb +0 -137
  110. data/test/integration/recoverable_test.rb +0 -349
  111. data/test/integration/registerable_test.rb +0 -365
  112. data/test/integration/rememberable_test.rb +0 -219
  113. data/test/integration/timeoutable_test.rb +0 -186
  114. data/test/integration/trackable_test.rb +0 -94
  115. data/test/mailers/confirmation_instructions_test.rb +0 -117
  116. data/test/mailers/email_changed_test.rb +0 -132
  117. data/test/mailers/mailer_test.rb +0 -20
  118. data/test/mailers/reset_password_instructions_test.rb +0 -98
  119. data/test/mailers/unlock_instructions_test.rb +0 -93
  120. data/test/mapping_test.rb +0 -136
  121. data/test/models/authenticatable_test.rb +0 -25
  122. data/test/models/confirmable_test.rb +0 -538
  123. data/test/models/database_authenticatable_test.rb +0 -283
  124. data/test/models/lockable_test.rb +0 -352
  125. data/test/models/omniauthable_test.rb +0 -9
  126. data/test/models/recoverable_test.rb +0 -263
  127. data/test/models/registerable_test.rb +0 -9
  128. data/test/models/rememberable_test.rb +0 -184
  129. data/test/models/serializable_test.rb +0 -60
  130. data/test/models/timeoutable_test.rb +0 -53
  131. data/test/models/trackable_test.rb +0 -52
  132. data/test/models/validatable_test.rb +0 -121
  133. data/test/models_test.rb +0 -155
  134. data/test/omniauth/config_test.rb +0 -61
  135. data/test/omniauth/url_helpers_test.rb +0 -53
  136. data/test/orm/active_record.rb +0 -19
  137. data/test/orm/mongoid.rb +0 -15
  138. data/test/parameter_sanitizer_test.rb +0 -77
  139. data/test/rails_app/Rakefile +0 -6
  140. data/test/rails_app/app/active_record/admin.rb +0 -8
  141. data/test/rails_app/app/active_record/shim.rb +0 -4
  142. data/test/rails_app/app/active_record/user.rb +0 -11
  143. data/test/rails_app/app/active_record/user_on_engine.rb +0 -9
  144. data/test/rails_app/app/active_record/user_on_main_app.rb +0 -9
  145. data/test/rails_app/app/active_record/user_with_validations.rb +0 -12
  146. data/test/rails_app/app/active_record/user_without_email.rb +0 -10
  147. data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -8
  148. data/test/rails_app/app/controllers/admins_controller.rb +0 -8
  149. data/test/rails_app/app/controllers/application_controller.rb +0 -13
  150. data/test/rails_app/app/controllers/application_with_fake_engine.rb +0 -32
  151. data/test/rails_app/app/controllers/custom/registrations_controller.rb +0 -33
  152. data/test/rails_app/app/controllers/home_controller.rb +0 -31
  153. data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -4
  154. data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -4
  155. data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -16
  156. data/test/rails_app/app/controllers/users_controller.rb +0 -33
  157. data/test/rails_app/app/helpers/application_helper.rb +0 -5
  158. data/test/rails_app/app/mailers/users/from_proc_mailer.rb +0 -5
  159. data/test/rails_app/app/mailers/users/mailer.rb +0 -5
  160. data/test/rails_app/app/mailers/users/reply_to_mailer.rb +0 -6
  161. data/test/rails_app/app/mongoid/admin.rb +0 -31
  162. data/test/rails_app/app/mongoid/shim.rb +0 -25
  163. data/test/rails_app/app/mongoid/user.rb +0 -41
  164. data/test/rails_app/app/mongoid/user_on_engine.rb +0 -41
  165. data/test/rails_app/app/mongoid/user_on_main_app.rb +0 -41
  166. data/test/rails_app/app/mongoid/user_with_validations.rb +0 -37
  167. data/test/rails_app/app/mongoid/user_without_email.rb +0 -35
  168. data/test/rails_app/app/views/admins/index.html.erb +0 -1
  169. data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
  170. data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
  171. data/test/rails_app/app/views/home/index.html.erb +0 -1
  172. data/test/rails_app/app/views/home/join.html.erb +0 -1
  173. data/test/rails_app/app/views/home/private.html.erb +0 -1
  174. data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
  175. data/test/rails_app/app/views/layouts/application.html.erb +0 -24
  176. data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
  177. data/test/rails_app/app/views/users/index.html.erb +0 -1
  178. data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
  179. data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
  180. data/test/rails_app/bin/bundle +0 -3
  181. data/test/rails_app/bin/rails +0 -4
  182. data/test/rails_app/bin/rake +0 -4
  183. data/test/rails_app/config.ru +0 -4
  184. data/test/rails_app/config/application.rb +0 -46
  185. data/test/rails_app/config/boot.rb +0 -22
  186. data/test/rails_app/config/database.yml +0 -18
  187. data/test/rails_app/config/environment.rb +0 -7
  188. data/test/rails_app/config/environments/development.rb +0 -32
  189. data/test/rails_app/config/environments/production.rb +0 -88
  190. data/test/rails_app/config/environments/test.rb +0 -47
  191. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -9
  192. data/test/rails_app/config/initializers/devise.rb +0 -182
  193. data/test/rails_app/config/initializers/inflections.rb +0 -4
  194. data/test/rails_app/config/initializers/secret_token.rb +0 -5
  195. data/test/rails_app/config/initializers/session_store.rb +0 -3
  196. data/test/rails_app/config/routes.rb +0 -128
  197. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -77
  198. data/test/rails_app/db/schema.rb +0 -57
  199. data/test/rails_app/lib/shared_admin.rb +0 -23
  200. data/test/rails_app/lib/shared_user.rb +0 -32
  201. data/test/rails_app/lib/shared_user_without_email.rb +0 -28
  202. data/test/rails_app/lib/shared_user_without_omniauth.rb +0 -15
  203. data/test/rails_app/public/404.html +0 -26
  204. data/test/rails_app/public/422.html +0 -26
  205. data/test/rails_app/public/500.html +0 -26
  206. data/test/rails_app/public/favicon.ico +0 -0
  207. data/test/rails_test.rb +0 -11
  208. data/test/routes_test.rb +0 -281
  209. data/test/support/action_controller/record_identifier.rb +0 -12
  210. data/test/support/assertions.rb +0 -30
  211. data/test/support/helpers.rb +0 -83
  212. data/test/support/http_method_compatibility.rb +0 -53
  213. data/test/support/integration.rb +0 -94
  214. data/test/support/locale/en.yml +0 -8
  215. data/test/support/mongoid.yml +0 -6
  216. data/test/support/webrat/integrations/rails.rb +0 -35
  217. data/test/test/controller_helpers_test.rb +0 -188
  218. data/test/test/integration_helpers_test.rb +0 -34
  219. data/test/test_helper.rb +0 -36
  220. data/test/test_models.rb +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 88289e9acf977a7ec40baba9cc607ad802dd6d7e
4
- data.tar.gz: b197dc5fb03fed5d94eae9ac6e3a740d7cb3f10a
2
+ SHA256:
3
+ metadata.gz: '056338b76007de25ec62deff781ba493d0d063184f70373d31406faf1fc8a219'
4
+ data.tar.gz: 43919f99b2b775b213bf40d5849138339b99462700e58ce5e4a843ab5a63c22f
5
5
  SHA512:
6
- metadata.gz: 84eef3b02c2b5ca07e7562ac7fa7bb310d465618e25aaa739e94ed96d1a4e4abfcaa997d61d6ca247d7580b661b1f81a9d49229c65deae0673254f5edee02ac8
7
- data.tar.gz: e52854fb48db7795e89c3542df182842499982332a5f11c0a8f802262b3d67049f21bbed01311763f1b160e8e514077f1d75ce8c2ea8b1eb9828eba6f248f6c6
6
+ metadata.gz: b21e1c4b5658dc2077d4eeb4fa70fa25c108bcdbe03b1b1f587d1a8f5c49a2c3b0fa299dc5a45af8b743ba8d8dc968bab768587df12350d41beeb163f6d80af3
7
+ data.tar.gz: c12702819c331ce7739ee30a34cdf550d85db4edbe90ad1c3adffe51c910a27f969938dc098940637c49acc31da0195cc351b56558bf4c2be69961f3071a23c6
@@ -1,4 +1,125 @@
1
- ### Unreleased
1
+ ### 4.7.3 - 2020-09-20
2
+
3
+ * bug fixes
4
+ * Do not modify `:except` option given to `#serializable_hash`. (by @dpep)
5
+ * Fix thor deprecation when running the devise generator. (by @deivid-rodriguez)
6
+ * Fix hanging tests for streaming controllers using Devise. (by @afn)
7
+
8
+ ### 4.7.2 - 2020-06-10
9
+
10
+ * enhancements
11
+ * Increase default stretches to 12 (by @sergey-alekseev)
12
+ * Ruby 2.7 support (kwarg warnings removed)
13
+
14
+ * bug fixes
15
+ * Generate scoped views with proper scoped errors partial (by @shobhitic)
16
+ * Allow to set scoped `already_authenticated` error messages (by @gurgelrenan)
17
+
18
+ ### 4.7.1 - 2019-09-06
19
+
20
+ * bug fixes
21
+ * Fix an edge case where records with a blank `confirmation_token` could be confirmed (by @tegon)
22
+ * Fix typo inside `update_needs_confirmation` i18n key (by @lslm)
23
+
24
+ ### 4.7.0 - 2019-08-19
25
+
26
+ * enhancements
27
+ * Support Rails 6.0
28
+ * Update CI to rails 6.0.0.beta3 (by @tunnes)
29
+ * refactor method name to be more consistent (by @saiqulhaq)
30
+ * Fix rails 6.0.rc1 email uniqueness validation deprecation warning (by @Vasfed)
31
+
32
+ * bug fixes
33
+ * Add `autocomplete="new-password"` to `password_confirmation` fields (by @ferrl)
34
+ * Fix rails_51_and_up? method for Rails 6.rc1 (by @igorkasyanchuk)
35
+
36
+ ### 4.6.2 - 2019-03-26
37
+
38
+ * bug fixes
39
+ * 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/heartcombo/devise/issues/5033#issuecomment-476386275 (by @mracos)
40
+
41
+ ### 4.6.1 - 2019-02-11
42
+
43
+ * bug fixes
44
+ * Check if `root_path` is defined with `#respond_to?` instead of `#present` (by @tegon)
45
+
46
+ ### 4.6.0 - 2019-02-07
47
+
48
+ * enhancements
49
+ * Allow to skip email and password change notifications (by @iorme1)
50
+ * Include the use of `nil` for `allow_unconfirmed_access_for` in the docs (by @joaumg)
51
+ * Ignore useless files into the `.gem` file (by @huacnlee)
52
+ * Explain the code that prevents enumeration attacks inside `Devise::Strategies::DatabaseAuthenticatable` (by @tegon)
53
+ * Refactor the `devise_error_messages!` helper to render a partial (by @prograhamer)
54
+ * Add an option (`Devise.sign_in_after_change_password`) to not automatically sign in a user after changing a password (by @knjko)
55
+
56
+ * bug fixes
57
+ * Fix missing comma in Simple Form generator (by @colinross)
58
+ * Fix error with migration generator in Rails 6 (by @oystersauce8)
59
+ * Set `encrypted_password` to `nil` when `password` is set to `nil` (by @sivagollapalli)
60
+ * Consider whether the request supports flash messages inside `Devise::Controllers::Helpers#is_flashing_format?` (by @colinross)
61
+ * Fix typo inside `Devise::Generators::ControllersGenerator` (by @kopylovvlad)
62
+ * Sanitize parameters inside `Devise::Models::Authenticatable#find_or_initialize_with_errors` (by @rlue)
63
+ * `#after_database_authentication` callback was not called after authentication on password reset (by @kanmaniselvan)
64
+ * 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)
65
+ * Fix unclosed `li` tag in `error_messages` partial (by @mracos)
66
+ * Fix Routes issue when devise engine is mounted in another engine on Rails versions lower than 5.1 (by @a-barbieri)
67
+ * Make `#increment_failed_attempts` concurrency safe (by @tegon)
68
+ * Apply Test Helper fix to Rails 6.0 as well as 5.x (by @matthewrudy)
69
+
70
+
71
+ * deprecations
72
+ * 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)
73
+ * 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)
74
+
75
+ ### 4.5.0 - 2018-08-15
76
+
77
+ * enhancements
78
+ * Use `before_action` instead of `before_filter` (by @edenthecat)
79
+ * Allow people to extend devise failure app, through invoking `ActiveSupport.run_load_hooks` once `Devise::FailureApp` is loaded (by @wnm)
80
+ * Use `update` instead of `update_attributes` (by @koic)
81
+ * Split IP resolution from `update_tracked_fields` (by @mckramer)
82
+ * upgrade dependencies for rails and responders (by @lancecarlson)
83
+ * Add `autocomplete="new-password"` to new password fields (by @gssbzn)
84
+ * Add `autocomplete="current-password"` to current password fields (by @gssbzn)
85
+ * Remove redundant `self` from `database_authenticatable` module (by @abhishekkanojia)
86
+ * Update `simple_form` templates with changes from https://github.com/heartcombo/devise/commit/16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and https://github.com/heartcombo/devise/commit/6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn)
87
+ * Remove `:trackable` from the default modules in the generators, to be more GDPR-friendly (by @fakenine)
88
+
89
+ * bug fixes
90
+ * Use same string on failed login regardless of whether account exists when in paranoid mode (by @TonyMK9068)
91
+ * Fix error when params is not a hash inside `Devise::ParameterSanitizer` (by @b0nn1e)
92
+ * Look for `secret_key_base` inside `Rails.application` (by @gencer)
93
+ * Ensure `Devise::ParameterFilter` does not add missing keys when called with a hash that has a `default` / `default_proc`
94
+ configured (by @joshpencheon)
95
+ * Adds `is_navigational_format?` check to `after_sign_up_path_for` to keep consistency (by @iorme1)
96
+
97
+ ### 4.4.3 - 2018-03-17
98
+
99
+ * bug fixes
100
+ * Fix undefined method `rails5?` for Devise::Test:Module (by @tegon)
101
+ * Fix: secret key was being required to be set inside credentials on Rails 5.2 (by @tegon)
102
+
103
+ ### 4.4.2 - 2018-03-15
104
+
105
+ * enhancements
106
+ * Support for :credentials on Rails v5.2.x. (by @gencer)
107
+ * Improve documentation about the test suite. (by @tegon)
108
+ * Test with Rails 5.2.rc1 on Travis. (by @jcoyne)
109
+ * Allow test with Rails 6. (by @Fudoshiki)
110
+ * Creating a new section for controller configuration on `devise.rb` template (by @Danilo-Araujo-Silva)
111
+
112
+ * bug fixes
113
+ * Preserve content_type for unauthenticated tests (by @gmcnaughton)
114
+ * Check if the resource is persisted in `update_tracked_fields!` instead of performing validations (by @tegon)
115
+ * Revert "Replace log_process_action to append_info_to_payload" (by @tegon)
116
+
117
+ ### 4.4.1 - 2018-01-23
118
+
119
+ * bug fixes
120
+ * Ensure Gemspec is loaded as utf-8. (by @segiddins)
121
+ * Fix `ActiveRecord` check on `Confirmable`. (by @tegon)
122
+ * Fix `signed_in?` docs without running auth hooks. by (@machty)
2
123
 
3
124
  ### 4.4.0 - 2017-12-29
4
125
 
@@ -17,7 +138,7 @@
17
138
  * Validations were being ignored on singup in the `Trackable#update_tracked_fields!` method. (by @AshleyFoster)
18
139
  * Do not modify options for `#serializable_hash`. (by @guigs)
19
140
  * 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)
20
-
141
+
21
142
  ### 4.3.0 - 2017-05-14
22
143
 
23
144
  * Enhancements
@@ -206,8 +327,8 @@
206
327
  end
207
328
  ```
208
329
 
209
- You can check more examples and explanations on the [README section](/plataformatec/devise#strong-parameters)
330
+ You can check more examples and explanations on the [README section](README.md#strong-parameters)
210
331
  and on the [ParameterSanitizer docs](lib/devise/parameter_sanitizer.rb).
211
332
 
212
- Please check [3-stable](https://github.com/plataformatec/devise/blob/3-stable/CHANGELOG.md)
333
+ Please check [3-stable](https://github.com/heartcombo/devise/blob/3-stable/CHANGELOG.md)
213
334
  for previous changes.
@@ -1,4 +1,5 @@
1
- Copyright 2009-2017 Plataformatec. http://plataformatec.com.br
1
+ Copyright 2020 Rafael França, Leonardo Tegon, Carlos Antônio da Silva.
2
+ Copyright 2009-2019 Plataformatec.
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,11 +1,7 @@
1
- ![Devise Logo](https://raw.github.com/plataformatec/devise/master/devise.png)
1
+ ![Devise Logo](https://raw.github.com/heartcombo/devise/master/devise.png)
2
2
 
3
- By [Plataformatec](http://plataformatec.com.br/).
4
-
5
- [![Build Status](https://api.travis-ci.org/plataformatec/devise.svg?branch=master)](http://travis-ci.org/plataformatec/devise)
6
- [![Code Climate](https://codeclimate.com/github/plataformatec/devise.svg)](https://codeclimate.com/github/plataformatec/devise)
7
-
8
- This README is [also available in a friendly navigable format](http://devise.plataformatec.com.br/).
3
+ [![Build Status](https://api.travis-ci.org/heartcombo/devise.svg?branch=master)](http://travis-ci.org/heartcombo/devise)
4
+ [![Code Climate](https://codeclimate.com/github/heartcombo/devise.svg)](https://codeclimate.com/github/heartcombo/devise)
9
5
 
10
6
  Devise is a flexible authentication solution for Rails based on Warden. It:
11
7
 
@@ -16,16 +12,16 @@ Devise is a flexible authentication solution for Rails based on Warden. It:
16
12
 
17
13
  It's composed of 10 modules:
18
14
 
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.
15
+ * [Database Authenticatable](http://www.rubydoc.info/github/heartcombo/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.
16
+ * [Omniauthable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support.
17
+ * [Confirmable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.
18
+ * [Recoverable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions.
19
+ * [Registerable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account.
20
+ * [Rememberable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie.
21
+ * [Trackable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address.
22
+ * [Timeoutable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Timeoutable): expires sessions that have not been active in a specified period of time.
23
+ * [Validatable](http://www.rubydoc.info/github/heartcombo/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.
24
+ * [Lockable](http://www.rubydoc.info/github/heartcombo/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
25
 
30
26
  ## Table of Contents
31
27
 
@@ -53,16 +49,11 @@ It's composed of 10 modules:
53
49
  - [Integration tests](#integration-tests)
54
50
  - [OmniAuth](#omniauth)
55
51
  - [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
52
  - [ActiveJob Integration](#activejob-integration)
62
53
  - [Password reset tokens and Rails logs](#password-reset-tokens-and-rails-logs)
63
54
  - [Other ORMs](#other-orms)
55
+ - [Rails API mode](#rails-api-mode)
64
56
  - [Additional information](#additional-information)
65
- - [Heroku](#heroku)
66
57
  - [Warden](#warden)
67
58
  - [Contributors](#contributors)
68
59
  - [License](#license)
@@ -77,15 +68,15 @@ It's composed of 10 modules:
77
68
 
78
69
  The Devise Wiki has lots of additional information about Devise including many "how-to" articles and answers to the most frequently asked questions. Please browse the Wiki after finishing this README:
79
70
 
80
- https://github.com/plataformatec/devise/wiki
71
+ https://github.com/heartcombo/devise/wiki
81
72
 
82
73
  ### Bug reports
83
74
 
84
75
  If you discover a problem with Devise, we would like to know about it. However, we ask that you please review these guidelines before submitting a bug report:
85
76
 
86
- https://github.com/plataformatec/devise/wiki/Bug-reports
77
+ https://github.com/heartcombo/devise/wiki/Bug-reports
87
78
 
88
- If you have discovered a security related bug, please do *NOT* use the GitHub issue tracker. Send an email to opensource@plataformatec.com.br.
79
+ If you have discovered a security related bug, please do *NOT* use the GitHub issue tracker. Send an email to heartcombo@googlegroups.com.
89
80
 
90
81
  ### StackOverflow and Mailing List
91
82
 
@@ -101,7 +92,7 @@ https://groups.google.com/group/plataformatec-devise
101
92
 
102
93
  You can view the Devise documentation in RDoc format here:
103
94
 
104
- http://rubydoc.info/github/plataformatec/devise/master/frames
95
+ http://rubydoc.info/github/heartcombo/devise/master/frames
105
96
 
106
97
  If you need to use Devise with previous versions of Rails, you can always run "gem server" from the command line after you install the gem to access the old documentation.
107
98
 
@@ -109,35 +100,82 @@ If you need to use Devise with previous versions of Rails, you can always run "g
109
100
 
110
101
  There are a few example applications available on GitHub that demonstrate various features of Devise with different versions of Rails. You can view them here:
111
102
 
112
- https://github.com/plataformatec/devise/wiki/Example-Applications
103
+ https://github.com/heartcombo/devise/wiki/Example-Applications
113
104
 
114
105
  ### Extensions
115
106
 
116
107
  Our community has created a number of extensions that add functionality above and beyond what is included with Devise. You can view a list of available extensions and add your own here:
117
108
 
118
- https://github.com/plataformatec/devise/wiki/Extensions
109
+ https://github.com/heartcombo/devise/wiki/Extensions
119
110
 
120
111
  ### Contributing
121
112
 
122
113
  We hope that you will consider contributing to Devise. Please read this short overview for some information about how to get started:
123
114
 
124
- https://github.com/plataformatec/devise/wiki/Contributing
115
+ https://github.com/heartcombo/devise/wiki/Contributing
116
+
117
+ You will usually want to write tests for your changes. To run the test suite, go into Devise's top-level directory and run `bundle install` and `bin/test`.
118
+ Devise works with multiple Ruby and Rails versions, and ActiveRecord and Mongoid ORMs, which means you can run the test suite with some modifiers: `DEVISE_ORM` and `BUNDLE_GEMFILE`.
119
+
120
+ ### DEVISE_ORM
121
+ Since Devise support both Mongoid and ActiveRecord, we rely on this variable to run specific code for each ORM.
122
+ The default value of `DEVISE_ORM` is `active_record`. To run the tests for Mongoid, you can pass `mongoid`:
123
+ ```
124
+ DEVISE_ORM=mongoid bin/test
125
125
 
126
- You will usually want to write tests for your changes. To run the test suite, go into Devise's top-level directory and run "bundle install" and "rake". For the tests to pass, you will need to have a MongoDB server (version 2.0 or newer) running on your system.
126
+ ==> Devise.orm = :mongoid
127
+ ```
128
+ When running the tests for Mongoid, you will need to have a MongoDB server (version 2.0 or newer) running on your system.
129
+
130
+ Please note that the command output will show the variable value being used.
131
+
132
+ ### BUNDLE_GEMFILE
133
+ We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory).
134
+ Inside the [gemfiles](https://github.com/heartcombo/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.
135
+ For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following:
136
+ ```bash
137
+ rbenv shell 2.4.2 # or rvm use 2.4.2
138
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bundle install
139
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bin/test
140
+ ```
141
+
142
+ You can also combine both of them if the tests broke for Mongoid:
143
+ ```bash
144
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bundle install
145
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable DEVISE_ORM=mongoid bin/test
146
+ ```
147
+
148
+ ### Running tests
149
+ Devise uses [Mini Test](https://github.com/seattlerb/minitest) as test framework.
150
+
151
+ * Running all tests:
152
+ ```bash
153
+ bin/test
154
+ ```
155
+
156
+ * Running tests for an specific file:
157
+ ```bash
158
+ bin/test test/models/trackable_test.rb
159
+ ```
160
+
161
+ * Running a specific test given a regex:
162
+ ```bash
163
+ bin/test test/models/trackable_test.rb:16
164
+ ```
127
165
 
128
166
  ## Starting with Rails?
129
167
 
130
- If you are building your first Rails application, we recommend you *do not* use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch. Today, we have three resources that should help you get started:
168
+ If you are building your first Rails application, we recommend you *do not* use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch. Here's a few resources that should help you get started:
131
169
 
132
170
  * Michael Hartl's online book: https://www.railstutorial.org/book/modeling_users
133
- * Ryan Bates' Railscast: http://railscasts.com/episodes/250-authentication-from-scratch
134
- * Codecademy's Ruby on Rails: Authentication and Authorization: http://www.codecademy.com/en/learn/rails-auth
171
+ * Ryan Bates' Railscasts: http://railscasts.com/episodes/250-authentication-from-scratch and http://railscasts.com/episodes/250-authentication-from-scratch-revised
172
+ * Codecademy's Ruby on Rails: Authentication and Authorization: https://www.codecademy.com/learn/rails-auth
135
173
 
136
174
  Once you have solidified your understanding of Rails and authentication mechanisms, we assure you Devise will be very pleasant to work with. :smiley:
137
175
 
138
176
  ## Getting started
139
177
 
140
- Devise 4.0 works with Rails 4.1 onwards. You can add it to your Gemfile with:
178
+ Devise 4.0 works with Rails 4.1 onwards. Add the following line to your Gemfile:
141
179
 
142
180
  ```ruby
143
181
  gem 'devise'
@@ -166,7 +204,7 @@ In the following command you will replace `MODEL` with the class name used for t
166
204
  $ rails generate devise MODEL
167
205
  ```
168
206
 
169
- 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.
207
+ 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.
170
208
 
171
209
  Then run `rails db:migrate`
172
210
 
@@ -227,16 +265,16 @@ member_session
227
265
  The Devise method in your models also accepts some options to configure its modules. For example, you can choose the cost of the hashing algorithm with:
228
266
 
229
267
  ```ruby
230
- devise :database_authenticatable, :registerable, :confirmable, :recoverable, stretches: 12
268
+ devise :database_authenticatable, :registerable, :confirmable, :recoverable, stretches: 13
231
269
  ```
232
270
 
233
271
  Besides `:stretches`, you can define `:pepper`, `:encryptor`, `:confirm_within`, `:remember_for`, `:timeout_in`, `:unlock_in` among other options. For more details, see the initializer file that was created when you invoked the "devise:install" generator described above. This file is usually located at `/config/initializers/devise.rb`.
234
272
 
235
273
  ### Strong Parameters
236
274
 
237
- ![The Parameter Sanitizer API has changed for Devise 4](http://messages.hellobits.com/warning.svg?message=The%20Parameter%20Sanitizer%20API%20has%20changed%20for%20Devise%204)
275
+ The Parameter Sanitizer API has changed for Devise 4 :warning:
238
276
 
239
- *For previous Devise versions see https://github.com/plataformatec/devise/tree/3-stable#strong-parameters*
277
+ *For previous Devise versions see https://github.com/heartcombo/devise/tree/3-stable#strong-parameters*
240
278
 
241
279
  When you customize your own views, you may end up adding new attributes to forms. Rails 4 moved the parameter sanitization from the model to the controller, causing Devise to handle this concern at the controller as well.
242
280
 
@@ -246,7 +284,7 @@ There are just three actions in Devise that allow any set of parameters to be pa
246
284
  * `sign_up` (`Devise::RegistrationsController#create`) - Permits authentication keys plus `password` and `password_confirmation`
247
285
  * `account_update` (`Devise::RegistrationsController#update`) - Permits authentication keys plus `password`, `password_confirmation` and `current_password`
248
286
 
249
- In case you want to permit additional parameters (the lazy way™), you can do so using a simple before filter in your `ApplicationController`:
287
+ In case you want to permit additional parameters (the lazy way™), you can do so using a simple before action in your `ApplicationController`:
250
288
 
251
289
  ```ruby
252
290
  class ApplicationController < ActionController::Base
@@ -274,7 +312,7 @@ class ApplicationController < ActionController::Base
274
312
  end
275
313
  ```
276
314
 
277
- Devise allows you to completely change Devise defaults or invoke custom behaviour by passing a block:
315
+ Devise allows you to completely change Devise defaults or invoke custom behavior by passing a block:
278
316
 
279
317
  To permit simple scalar values for username and email, use this
280
318
 
@@ -375,6 +413,7 @@ If the customization at the views level is not enough, you can customize each co
375
413
  ...
376
414
  end
377
415
  ```
416
+ (Use the -c flag to specify a controller, for example: `rails generate devise:controllers users -c=sessions`)
378
417
 
379
418
  2. Tell the router to use this controller:
380
419
 
@@ -396,7 +435,7 @@ If the customization at the views level is not enough, you can customize each co
396
435
  end
397
436
  ```
398
437
 
399
- Or you can simply add new behaviour to it:
438
+ Or you can simply add new behavior to it:
400
439
 
401
440
  ```ruby
402
441
  class Users::SessionsController < Devise::SessionsController
@@ -420,7 +459,7 @@ Devise also ships with default routes. If you need to customize them, you should
420
459
  devise_for :users, path: 'auth', path_names: { sign_in: 'login', sign_out: 'logout', password: 'secret', confirmation: 'verification', unlock: 'unblock', registration: 'register', sign_up: 'cmon_let_me_in' }
421
460
  ```
422
461
 
423
- Be sure to check `devise_for` [documentation](http://www.rubydoc.info/github/plataformatec/devise/master/ActionDispatch/Routing/Mapper%3Adevise_for) for details.
462
+ Be sure to check `devise_for` [documentation](http://www.rubydoc.info/github/heartcombo/devise/master/ActionDispatch/Routing/Mapper%3Adevise_for) for details.
424
463
 
425
464
  If you have the need for more deep customization, for instance to also allow "/sign_in" besides "/users/sign_in", all you need to do is create your routes normally and wrap them in a `devise_scope` block in the router:
426
465
 
@@ -476,7 +515,7 @@ en:
476
515
 
477
516
  Take a look at our locale file to check all available messages. You may also be interested in one of the many translations that are available on our wiki:
478
517
 
479
- https://github.com/plataformatec/devise/wiki/I18n
518
+ https://github.com/heartcombo/devise/wiki/I18n
480
519
 
481
520
  Caution: Devise Controllers inherit from ApplicationController. If your app uses multiple locales, you should be sure to set I18n.locale in ApplicationController.
482
521
 
@@ -488,12 +527,21 @@ cases/specs.
488
527
 
489
528
  ### Controller tests
490
529
 
491
- Controller tests require that you include `Devise::Test::ControllerHelpers` on
530
+ Controller tests require that you include `Devise::Test::IntegrationHelpers` on
492
531
  your test case or its parent `ActionController::TestCase` superclass.
532
+ For Rails versions prior to 5, include `Devise::Test::ControllerHelpers` instead, since the superclass
533
+ for controller tests was changed to ActionDispatch::IntegrationTest
534
+ (for more details, see the [Integration tests](#integration-tests) section).
535
+
536
+ ```ruby
537
+ class PostsControllerTest < ActionController::TestCase
538
+ include Devise::Test::IntegrationHelpers # Rails >= 5
539
+ end
540
+ ```
493
541
 
494
542
  ```ruby
495
543
  class PostsControllerTest < ActionController::TestCase
496
- include Devise::Test::ControllerHelpers
544
+ include Devise::Test::ControllerHelpers # Rails < 5
497
545
  end
498
546
  ```
499
547
 
@@ -573,7 +621,7 @@ are executed in your tests.
573
621
 
574
622
  You can read more about testing your Rails 3 - Rails 4 controllers with RSpec in the wiki:
575
623
 
576
- * https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-%28and-RSpec%29
624
+ * https://github.com/heartcombo/devise/wiki/How-To:-Test-controllers-with-Rails-(and-RSpec)
577
625
 
578
626
  ### OmniAuth
579
627
 
@@ -585,7 +633,7 @@ config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
585
633
 
586
634
  You can read more about OmniAuth support in the wiki:
587
635
 
588
- * https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
636
+ * https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview
589
637
 
590
638
  ### Configuring multiple models
591
639
 
@@ -632,7 +680,7 @@ end
632
680
 
633
681
  ### Password reset tokens and Rails logs
634
682
 
635
- If you enable the [Recoverable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable) module, note that a stolen password reset token could give an attacker access to your application. Devise takes effort to generate random, secure tokens, and stores only token digests in the database, never plaintext. However the default logging behavior in Rails can cause plaintext tokens to leak into log files:
683
+ If you enable the [Recoverable](http://rubydoc.info/github/heartcombo/devise/master/Devise/Models/Recoverable) module, note that a stolen password reset token could give an attacker access to your application. Devise takes effort to generate random, secure tokens, and stores only token digests in the database, never plaintext. However the default logging behavior in Rails can cause plaintext tokens to leak into log files:
636
684
 
637
685
  1. Action Mailer logs the entire contents of all outgoing emails to the DEBUG level. Password reset tokens delivered to users in email will be leaked.
638
686
  2. Active Job logs all arguments to every enqueued job at the INFO level. If you configure Devise to use `deliver_later` to send password reset emails, password reset tokens will be leaked.
@@ -648,32 +696,50 @@ config.log_level = :warn
648
696
 
649
697
  Devise supports ActiveRecord (default) and Mongoid. To select another ORM, simply require it in the initializer file.
650
698
 
651
- ## Additional information
699
+ ### Rails API Mode
700
+
701
+ Rails 5+ has a built-in [API Mode](https://edgeguides.rubyonrails.org/api_app.html) which optimizes Rails for use as an API (only). Devise is _somewhat_ able to handle applications that are built in this mode without additional modifications in the sense that it should not raise exceptions and the like. But some issues may still arise during `development`/`testing`, as we still don't know the full extent of this compatibility. (For more information, see [issue #4947](https://github.com/heartcombo/devise/issues/4947/))
652
702
 
653
- ### Heroku
703
+ #### Supported Authentication Strategies
704
+ API-only applications don't support browser-based authentication via cookies, which is devise's default. Yet, devise can still provide authentication out of the box in those cases with the `http_authenticatable` strategy, which uses HTTP Basic Auth and authenticates the user on each request. (For more info, see this wiki article for [How To: Use HTTP Basic Authentication](https://github.com/heartcombo/devise/wiki/How-To:-Use-HTTP-Basic-Authentication))
654
705
 
655
- Using Devise on Heroku with Ruby on Rails 3.2 requires setting:
706
+ The devise default for HTTP Auth is disabled, so it will need to be enabled in the devise initializer for the database strategy:
656
707
 
657
708
  ```ruby
658
- config.assets.initialize_on_precompile = false
709
+ config.http_authenticatable = [:database]
659
710
  ```
660
711
 
661
- Read more about the potential issues at http://guides.rubyonrails.org/asset_pipeline.html
712
+ This restriction does not limit you from implementing custom warden strategies, either in your application or via gem-based extensions for devise.
713
+ A common authentication strategy for APIs is token-based authentication. For more information on extending devise to support this type of authentication and others, see the wiki article for [Simple Token Authentication Examples and alternatives](https://github.com/heartcombo/devise/wiki/How-To:-Simple-Token-Authentication-Example#alternatives) or this blog post on [Custom authentication methods with Devise](http://blog.plataformatec.com.br/2019/01/custom-authentication-methods-with-devise/).
714
+
715
+ #### Testing
716
+ API Mode changes the order of the middleware stack, and this can cause problems for `Devise::Test::IntegrationHelpers`. This problem usually surfaces as an ```undefined method `[]=' for nil:NilClass``` error when using integration test helpers, such as `#sign_in`. The solution is simply to reorder the middlewares by adding the following to test.rb:
717
+
718
+ ```ruby
719
+ Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Cookies
720
+ Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Session::CookieStore
721
+ ```
722
+
723
+ For a deeper understanding of this, review [this issue](https://github.com/heartcombo/devise/issues/4696).
724
+
725
+ Additionally be mindful that without views supported, some email-based flows from Confirmable, Recoverable and Lockable are not supported directly at this time.
726
+
727
+ ## Additional information
662
728
 
663
729
  ### Warden
664
730
 
665
731
  Devise is based on Warden, which is a general Rack authentication framework created by Daniel Neighman. We encourage you to read more about Warden here:
666
732
 
667
- https://github.com/hassox/warden
733
+ https://github.com/wardencommunity/warden
668
734
 
669
735
  ### Contributors
670
736
 
671
737
  We have a long list of valued contributors. Check them all at:
672
738
 
673
- https://github.com/plataformatec/devise/graphs/contributors
739
+ https://github.com/heartcombo/devise/graphs/contributors
674
740
 
675
741
  ## License
676
742
 
677
- MIT License. Copyright 2009-2017 Plataformatec. http://plataformatec.com.br
743
+ MIT License. Copyright 2020 Rafael França, Leonardo Tegon, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
678
744
 
679
- You are not granted rights or licenses to the trademarks of Plataformatec, including without limitation the Devise name or logo.
745
+ The Devise logo is licensed under [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).