devise 4.1.1 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +224 -4
  3. data/MIT-LICENSE +2 -1
  4. data/README.md +275 -90
  5. data/app/controllers/devise/confirmations_controller.rb +2 -0
  6. data/app/controllers/devise/omniauth_callbacks_controller.rb +7 -5
  7. data/app/controllers/devise/passwords_controller.rb +3 -0
  8. data/app/controllers/devise/registrations_controller.rb +34 -13
  9. data/app/controllers/devise/sessions_controller.rb +3 -1
  10. data/app/controllers/devise/unlocks_controller.rb +2 -0
  11. data/app/controllers/devise_controller.rb +5 -3
  12. data/app/helpers/devise_helper.rb +23 -18
  13. data/app/mailers/devise/mailer.rb +10 -4
  14. data/app/views/devise/confirmations/new.html.erb +2 -2
  15. data/app/views/devise/mailer/email_changed.html.erb +7 -0
  16. data/app/views/devise/passwords/edit.html.erb +3 -3
  17. data/app/views/devise/passwords/new.html.erb +2 -2
  18. data/app/views/devise/registrations/edit.html.erb +9 -5
  19. data/app/views/devise/registrations/new.html.erb +4 -4
  20. data/app/views/devise/sessions/new.html.erb +4 -4
  21. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  22. data/app/views/devise/shared/_links.html.erb +8 -8
  23. data/app/views/devise/unlocks/new.html.erb +2 -2
  24. data/config/locales/en.yml +5 -2
  25. data/lib/devise.rb +39 -17
  26. data/lib/devise/controllers/helpers.rb +22 -9
  27. data/lib/devise/controllers/rememberable.rb +3 -1
  28. data/lib/devise/controllers/scoped_views.rb +2 -0
  29. data/lib/devise/controllers/sign_in_out.rb +39 -14
  30. data/lib/devise/controllers/store_location.rb +25 -7
  31. data/lib/devise/controllers/url_helpers.rb +3 -1
  32. data/lib/devise/delegator.rb +2 -0
  33. data/lib/devise/encryptor.rb +2 -0
  34. data/lib/devise/failure_app.rb +63 -33
  35. data/lib/devise/hooks/activatable.rb +2 -0
  36. data/lib/devise/hooks/csrf_cleaner.rb +2 -0
  37. data/lib/devise/hooks/forgetable.rb +2 -0
  38. data/lib/devise/hooks/lockable.rb +4 -2
  39. data/lib/devise/hooks/proxy.rb +3 -1
  40. data/lib/devise/hooks/rememberable.rb +2 -0
  41. data/lib/devise/hooks/timeoutable.rb +4 -2
  42. data/lib/devise/hooks/trackable.rb +2 -0
  43. data/lib/devise/mailers/helpers.rb +6 -3
  44. data/lib/devise/mapping.rb +3 -1
  45. data/lib/devise/models.rb +3 -1
  46. data/lib/devise/models/authenticatable.rb +63 -37
  47. data/lib/devise/models/confirmable.rb +79 -22
  48. data/lib/devise/models/database_authenticatable.rb +86 -17
  49. data/lib/devise/models/lockable.rb +17 -3
  50. data/lib/devise/models/omniauthable.rb +2 -0
  51. data/lib/devise/models/recoverable.rb +32 -20
  52. data/lib/devise/models/registerable.rb +4 -0
  53. data/lib/devise/models/rememberable.rb +5 -3
  54. data/lib/devise/models/timeoutable.rb +2 -0
  55. data/lib/devise/models/trackable.rb +15 -1
  56. data/lib/devise/models/validatable.rb +10 -3
  57. data/lib/devise/modules.rb +2 -0
  58. data/lib/devise/omniauth.rb +4 -5
  59. data/lib/devise/omniauth/config.rb +2 -0
  60. data/lib/devise/omniauth/url_helpers.rb +2 -51
  61. data/lib/devise/orm/active_record.rb +5 -1
  62. data/lib/devise/orm/mongoid.rb +6 -2
  63. data/lib/devise/parameter_filter.rb +4 -0
  64. data/lib/devise/parameter_sanitizer.rb +15 -56
  65. data/lib/devise/rails.rb +6 -6
  66. data/lib/devise/rails/deprecated_constant_accessor.rb +39 -0
  67. data/lib/devise/rails/routes.rb +9 -7
  68. data/lib/devise/rails/warden_compat.rb +2 -0
  69. data/lib/devise/secret_key_finder.rb +27 -0
  70. data/lib/devise/strategies/authenticatable.rb +3 -1
  71. data/lib/devise/strategies/base.rb +2 -0
  72. data/lib/devise/strategies/database_authenticatable.rb +8 -1
  73. data/lib/devise/strategies/rememberable.rb +2 -0
  74. data/lib/devise/test/controller_helpers.rb +167 -0
  75. data/lib/devise/test/integration_helpers.rb +63 -0
  76. data/lib/devise/test_helpers.rb +7 -129
  77. data/lib/devise/time_inflector.rb +2 -0
  78. data/lib/devise/token_generator.rb +2 -0
  79. data/lib/devise/version.rb +3 -1
  80. data/lib/generators/active_record/devise_generator.rb +40 -12
  81. data/lib/generators/active_record/templates/migration.rb +3 -1
  82. data/lib/generators/active_record/templates/migration_existing.rb +2 -0
  83. data/lib/generators/devise/controllers_generator.rb +3 -1
  84. data/lib/generators/devise/devise_generator.rb +5 -3
  85. data/lib/generators/devise/install_generator.rb +3 -5
  86. data/lib/generators/devise/orm_helpers.rb +9 -3
  87. data/lib/generators/devise/views_generator.rb +8 -9
  88. data/lib/generators/mongoid/devise_generator.rb +7 -5
  89. data/lib/generators/templates/README +9 -8
  90. data/lib/generators/templates/controllers/confirmations_controller.rb +2 -0
  91. data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +3 -1
  92. data/lib/generators/templates/controllers/passwords_controller.rb +2 -0
  93. data/lib/generators/templates/controllers/registrations_controller.rb +4 -2
  94. data/lib/generators/templates/controllers/sessions_controller.rb +3 -1
  95. data/lib/generators/templates/controllers/unlocks_controller.rb +2 -0
  96. data/lib/generators/templates/devise.rb +49 -6
  97. data/lib/generators/templates/markerb/email_changed.markerb +7 -0
  98. data/lib/generators/templates/markerb/password_change.markerb +2 -2
  99. data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
  100. data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +10 -2
  101. data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
  102. data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -3
  103. data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
  104. data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
  105. data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
  106. metadata +16 -297
  107. data/.gitignore +0 -10
  108. data/.travis.yml +0 -44
  109. data/.yardopts +0 -9
  110. data/CODE_OF_CONDUCT.md +0 -22
  111. data/CONTRIBUTING.md +0 -16
  112. data/Gemfile +0 -30
  113. data/Gemfile.lock +0 -182
  114. data/Rakefile +0 -36
  115. data/bin/test +0 -13
  116. data/devise.gemspec +0 -26
  117. data/devise.png +0 -0
  118. data/gemfiles/Gemfile.rails-4.1-stable +0 -30
  119. data/gemfiles/Gemfile.rails-4.1-stable.lock +0 -170
  120. data/gemfiles/Gemfile.rails-4.2-stable +0 -30
  121. data/gemfiles/Gemfile.rails-4.2-stable.lock +0 -192
  122. data/gemfiles/Gemfile.rails-5.0-beta +0 -37
  123. data/gemfiles/Gemfile.rails-5.0-beta.lock +0 -199
  124. data/test/controllers/custom_registrations_controller_test.rb +0 -40
  125. data/test/controllers/custom_strategy_test.rb +0 -64
  126. data/test/controllers/helper_methods_test.rb +0 -22
  127. data/test/controllers/helpers_test.rb +0 -316
  128. data/test/controllers/inherited_controller_i18n_messages_test.rb +0 -51
  129. data/test/controllers/internal_helpers_test.rb +0 -127
  130. data/test/controllers/load_hooks_controller_test.rb +0 -19
  131. data/test/controllers/passwords_controller_test.rb +0 -32
  132. data/test/controllers/sessions_controller_test.rb +0 -106
  133. data/test/controllers/url_helpers_test.rb +0 -65
  134. data/test/delegator_test.rb +0 -19
  135. data/test/devise_test.rb +0 -107
  136. data/test/failure_app_test.rb +0 -320
  137. data/test/generators/active_record_generator_test.rb +0 -83
  138. data/test/generators/controllers_generator_test.rb +0 -48
  139. data/test/generators/devise_generator_test.rb +0 -39
  140. data/test/generators/install_generator_test.rb +0 -24
  141. data/test/generators/mongoid_generator_test.rb +0 -23
  142. data/test/generators/views_generator_test.rb +0 -103
  143. data/test/helpers/devise_helper_test.rb +0 -49
  144. data/test/integration/authenticatable_test.rb +0 -698
  145. data/test/integration/confirmable_test.rb +0 -324
  146. data/test/integration/database_authenticatable_test.rb +0 -95
  147. data/test/integration/http_authenticatable_test.rb +0 -106
  148. data/test/integration/lockable_test.rb +0 -240
  149. data/test/integration/omniauthable_test.rb +0 -135
  150. data/test/integration/recoverable_test.rb +0 -347
  151. data/test/integration/registerable_test.rb +0 -357
  152. data/test/integration/rememberable_test.rb +0 -211
  153. data/test/integration/timeoutable_test.rb +0 -184
  154. data/test/integration/trackable_test.rb +0 -92
  155. data/test/mailers/confirmation_instructions_test.rb +0 -115
  156. data/test/mailers/reset_password_instructions_test.rb +0 -96
  157. data/test/mailers/unlock_instructions_test.rb +0 -91
  158. data/test/mapping_test.rb +0 -134
  159. data/test/models/authenticatable_test.rb +0 -23
  160. data/test/models/confirmable_test.rb +0 -511
  161. data/test/models/database_authenticatable_test.rb +0 -269
  162. data/test/models/lockable_test.rb +0 -350
  163. data/test/models/omniauthable_test.rb +0 -7
  164. data/test/models/recoverable_test.rb +0 -251
  165. data/test/models/registerable_test.rb +0 -7
  166. data/test/models/rememberable_test.rb +0 -169
  167. data/test/models/serializable_test.rb +0 -49
  168. data/test/models/timeoutable_test.rb +0 -51
  169. data/test/models/trackable_test.rb +0 -41
  170. data/test/models/validatable_test.rb +0 -119
  171. data/test/models_test.rb +0 -153
  172. data/test/omniauth/config_test.rb +0 -57
  173. data/test/omniauth/url_helpers_test.rb +0 -51
  174. data/test/orm/active_record.rb +0 -17
  175. data/test/orm/mongoid.rb +0 -13
  176. data/test/parameter_sanitizer_test.rb +0 -131
  177. data/test/rails_app/Rakefile +0 -6
  178. data/test/rails_app/app/active_record/admin.rb +0 -6
  179. data/test/rails_app/app/active_record/shim.rb +0 -2
  180. data/test/rails_app/app/active_record/user.rb +0 -7
  181. data/test/rails_app/app/active_record/user_on_engine.rb +0 -7
  182. data/test/rails_app/app/active_record/user_on_main_app.rb +0 -7
  183. data/test/rails_app/app/active_record/user_without_email.rb +0 -8
  184. data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -6
  185. data/test/rails_app/app/controllers/admins_controller.rb +0 -6
  186. data/test/rails_app/app/controllers/application_controller.rb +0 -11
  187. data/test/rails_app/app/controllers/application_with_fake_engine.rb +0 -30
  188. data/test/rails_app/app/controllers/custom/registrations_controller.rb +0 -31
  189. data/test/rails_app/app/controllers/home_controller.rb +0 -29
  190. data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -2
  191. data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -2
  192. data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -14
  193. data/test/rails_app/app/controllers/users_controller.rb +0 -31
  194. data/test/rails_app/app/helpers/application_helper.rb +0 -3
  195. data/test/rails_app/app/mailers/users/from_proc_mailer.rb +0 -3
  196. data/test/rails_app/app/mailers/users/mailer.rb +0 -3
  197. data/test/rails_app/app/mailers/users/reply_to_mailer.rb +0 -4
  198. data/test/rails_app/app/mongoid/admin.rb +0 -29
  199. data/test/rails_app/app/mongoid/shim.rb +0 -23
  200. data/test/rails_app/app/mongoid/user.rb +0 -39
  201. data/test/rails_app/app/mongoid/user_on_engine.rb +0 -39
  202. data/test/rails_app/app/mongoid/user_on_main_app.rb +0 -39
  203. data/test/rails_app/app/mongoid/user_without_email.rb +0 -33
  204. data/test/rails_app/app/views/admins/index.html.erb +0 -1
  205. data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
  206. data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
  207. data/test/rails_app/app/views/home/index.html.erb +0 -1
  208. data/test/rails_app/app/views/home/join.html.erb +0 -1
  209. data/test/rails_app/app/views/home/private.html.erb +0 -1
  210. data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
  211. data/test/rails_app/app/views/layouts/application.html.erb +0 -24
  212. data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
  213. data/test/rails_app/app/views/users/index.html.erb +0 -1
  214. data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
  215. data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
  216. data/test/rails_app/bin/bundle +0 -3
  217. data/test/rails_app/bin/rails +0 -4
  218. data/test/rails_app/bin/rake +0 -4
  219. data/test/rails_app/config.ru +0 -4
  220. data/test/rails_app/config/application.rb +0 -44
  221. data/test/rails_app/config/boot.rb +0 -14
  222. data/test/rails_app/config/database.yml +0 -18
  223. data/test/rails_app/config/environment.rb +0 -5
  224. data/test/rails_app/config/environments/development.rb +0 -30
  225. data/test/rails_app/config/environments/production.rb +0 -84
  226. data/test/rails_app/config/environments/test.rb +0 -46
  227. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  228. data/test/rails_app/config/initializers/devise.rb +0 -180
  229. data/test/rails_app/config/initializers/inflections.rb +0 -2
  230. data/test/rails_app/config/initializers/secret_token.rb +0 -3
  231. data/test/rails_app/config/initializers/session_store.rb +0 -1
  232. data/test/rails_app/config/routes.rb +0 -126
  233. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -71
  234. data/test/rails_app/db/schema.rb +0 -55
  235. data/test/rails_app/lib/shared_admin.rb +0 -17
  236. data/test/rails_app/lib/shared_user.rb +0 -30
  237. data/test/rails_app/lib/shared_user_without_email.rb +0 -26
  238. data/test/rails_app/lib/shared_user_without_omniauth.rb +0 -13
  239. data/test/rails_app/public/404.html +0 -26
  240. data/test/rails_app/public/422.html +0 -26
  241. data/test/rails_app/public/500.html +0 -26
  242. data/test/rails_app/public/favicon.ico +0 -0
  243. data/test/rails_test.rb +0 -9
  244. data/test/routes_test.rb +0 -279
  245. data/test/support/action_controller/record_identifier.rb +0 -10
  246. data/test/support/assertions.rb +0 -39
  247. data/test/support/helpers.rb +0 -77
  248. data/test/support/http_method_compatibility.rb +0 -51
  249. data/test/support/integration.rb +0 -92
  250. data/test/support/locale/en.yml +0 -8
  251. data/test/support/mongoid.yml +0 -6
  252. data/test/support/webrat/integrations/rails.rb +0 -33
  253. data/test/test_helper.rb +0 -34
  254. data/test/test_helpers_test.rb +0 -178
  255. data/test/test_models.rb +0 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ae66c3c22e62e034ece98b6498c993737bd056e9
4
- data.tar.gz: a278bfa6812d8470f2e4b732dcad3ad858b9cd02
2
+ SHA256:
3
+ metadata.gz: 197ce185bf22b8dc45c17a615895b60e6b788360113c37d99a116db868197309
4
+ data.tar.gz: 8e3fa67c5bcd6c05ac3011e0b35f0cda57596ae74c2affceab84cab1da3aeb58
5
5
  SHA512:
6
- metadata.gz: be13b50cfa7a16324637907e62236b1627b997fdf10081bb4513f65494461e24bccdf65410e582f0d4e8a69327e407b893e7a6e9e81367e5685fad316065f18d
7
- data.tar.gz: 7697239a9ead6ee62a0d2eb25f4037b889b84a6eaf07079c8b41d98ad91924a3513e5a669e88a33e35544ec986faa14f35a0c30b28871001db4ae798afbef8e6
6
+ metadata.gz: 8d3f76d9e898d36dc6eb4db5d5b098b76d339aeadac014c772b7097dc6a730a7577049bd00ea7a073beead47454edb91d24fe73b50e90af3555cc5e83886902f
7
+ data.tar.gz: 84cbafa77c70de3c204dfdf19e4ce53ac05796eaf959bba4d4909d0c91686baa6da61f732e13bce0892d8932af375d2b81340f6bd1047384f15325f8a24011e0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,218 @@
1
+ ### unreleased
2
+
3
+ ### 4.8.0 - 2021-04-29
4
+
5
+ * enhancements
6
+ * Devise now enables the upgrade of OmniAuth 2+. Previously Devise would raise an error if you'd try to upgrade. Please note that OmniAuth 2 is considered a security upgrade and recommended to everyone. You can read more about the details (and possible necessary changes to your app as part of the upgrade) in [their release notes](https://github.com/omniauth/omniauth/releases/tag/v2.0.0). [Devise's OmniAuth Overview wiki](https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview) was also updated to cover OmniAuth 2.0 requirements.
7
+ - Note that the upgrade required Devise shared links that initiate the OmniAuth flow to be changed to `method: :post`, which is now a requirement for OmniAuth, part of the security improvement. If you have copied and customized the Devise shared links partial to your app, or if you have other links in your app that initiate the OmniAuth flow, they will have to be updated to use `method: :post`, or changed to use buttons (e.g. `button_to`) to work with OmniAuth 2. (if you're using links with `method: :post`, make sure your app has `rails-ujs` or `jquery-ujs` included in order for these links to work properly.)
8
+ - As part of the OmniAuth 2.0 upgrade you might also need to add the [`omniauth-rails_csrf_protection`](https://github.com/cookpad/omniauth-rails_csrf_protection) gem to your app if you don't have it already. (and you don't want to roll your own code to verify requests.) Check the OmniAuth v2 release notes for more info.
9
+ * Introduce `Lockable#reset_failed_attempts!` model method to reset failed attempts counter to 0 after the user signs in.
10
+ - This logic existed inside the lockable warden hook and is triggered automatically after the user signs in. The new model method is an extraction to allow you to override it in the application to implement things like switching to a write database if you're using the new multi-DB infrastructure from Rails for example, similar to how it's already possible with `Trackable#update_tracked_fields!`.
11
+ * Add support for Ruby 3.
12
+ * Add support for Rails 6.1.
13
+ * Move CI to GitHub Actions.
14
+
15
+ * deprecations
16
+ * `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION` is deprecated in favor of `Devise::Models::Authenticatable::UNSAFE_ATTRIBUTES_FOR_SERIALIZATION` (@hanachin)
17
+
18
+ ### 4.7.3 - 2020-09-20
19
+
20
+ * bug fixes
21
+ * Do not modify `:except` option given to `#serializable_hash`. (by @dpep)
22
+ * Fix thor deprecation when running the devise generator. (by @deivid-rodriguez)
23
+ * Fix hanging tests for streaming controllers using Devise. (by @afn)
24
+
25
+ ### 4.7.2 - 2020-06-10
26
+
27
+ * enhancements
28
+ * Increase default stretches to 12 (by @sergey-alekseev)
29
+ * Ruby 2.7 support (kwarg warnings removed)
30
+
31
+ * bug fixes
32
+ * Generate scoped views with proper scoped errors partial (by @shobhitic)
33
+ * Allow to set scoped `already_authenticated` error messages (by @gurgelrenan)
34
+
35
+ ### 4.7.1 - 2019-09-06
36
+
37
+ * bug fixes
38
+ * Fix an edge case where records with a blank `confirmation_token` could be confirmed (by @tegon)
39
+ * Fix typo inside `update_needs_confirmation` i18n key (by @lslm)
40
+
41
+ ### 4.7.0 - 2019-08-19
42
+
43
+ * enhancements
44
+ * Support Rails 6.0
45
+ * Update CI to rails 6.0.0.beta3 (by @tunnes)
46
+ * refactor method name to be more consistent (by @saiqulhaq)
47
+ * Fix rails 6.0.rc1 email uniqueness validation deprecation warning (by @Vasfed)
48
+
49
+ * bug fixes
50
+ * Add `autocomplete="new-password"` to `password_confirmation` fields (by @ferrl)
51
+ * Fix rails_51_and_up? method for Rails 6.rc1 (by @igorkasyanchuk)
52
+
53
+ ### 4.6.2 - 2019-03-26
54
+
55
+ * bug fixes
56
+ * 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)
57
+
58
+ ### 4.6.1 - 2019-02-11
59
+
60
+ * bug fixes
61
+ * Check if `root_path` is defined with `#respond_to?` instead of `#present` (by @tegon)
62
+
63
+ ### 4.6.0 - 2019-02-07
64
+
65
+ * enhancements
66
+ * Allow to skip email and password change notifications (by @iorme1)
67
+ * Include the use of `nil` for `allow_unconfirmed_access_for` in the docs (by @joaumg)
68
+ * Ignore useless files into the `.gem` file (by @huacnlee)
69
+ * Explain the code that prevents enumeration attacks inside `Devise::Strategies::DatabaseAuthenticatable` (by @tegon)
70
+ * Refactor the `devise_error_messages!` helper to render a partial (by @prograhamer)
71
+ * Add an option (`Devise.sign_in_after_change_password`) to not automatically sign in a user after changing a password (by @knjko)
72
+
73
+ * bug fixes
74
+ * Fix missing comma in Simple Form generator (by @colinross)
75
+ * Fix error with migration generator in Rails 6 (by @oystersauce8)
76
+ * Set `encrypted_password` to `nil` when `password` is set to `nil` (by @sivagollapalli)
77
+ * Consider whether the request supports flash messages inside `Devise::Controllers::Helpers#is_flashing_format?` (by @colinross)
78
+ * Fix typo inside `Devise::Generators::ControllersGenerator` (by @kopylovvlad)
79
+ * Sanitize parameters inside `Devise::Models::Authenticatable#find_or_initialize_with_errors` (by @rlue)
80
+ * `#after_database_authentication` callback was not called after authentication on password reset (by @kanmaniselvan)
81
+ * 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)
82
+ * Fix unclosed `li` tag in `error_messages` partial (by @mracos)
83
+ * Fix Routes issue when devise engine is mounted in another engine on Rails versions lower than 5.1 (by @a-barbieri)
84
+ * Make `#increment_failed_attempts` concurrency safe (by @tegon)
85
+ * Apply Test Helper fix to Rails 6.0 as well as 5.x (by @matthewrudy)
86
+
87
+
88
+ * deprecations
89
+ * 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)
90
+ * 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)
91
+
92
+ ### 4.5.0 - 2018-08-15
93
+
94
+ * enhancements
95
+ * Use `before_action` instead of `before_filter` (by @edenthecat)
96
+ * Allow people to extend devise failure app, through invoking `ActiveSupport.run_load_hooks` once `Devise::FailureApp` is loaded (by @wnm)
97
+ * Use `update` instead of `update_attributes` (by @koic)
98
+ * Split IP resolution from `update_tracked_fields` (by @mckramer)
99
+ * upgrade dependencies for rails and responders (by @lancecarlson)
100
+ * Add `autocomplete="new-password"` to new password fields (by @gssbzn)
101
+ * Add `autocomplete="current-password"` to current password fields (by @gssbzn)
102
+ * Remove redundant `self` from `database_authenticatable` module (by @abhishekkanojia)
103
+ * Update `simple_form` templates with changes from https://github.com/heartcombo/devise/commit/16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and https://github.com/heartcombo/devise/commit/6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn)
104
+ * Remove `:trackable` from the default modules in the generators, to be more GDPR-friendly (by @fakenine)
105
+
106
+ * bug fixes
107
+ * Use same string on failed login regardless of whether account exists when in paranoid mode (by @TonyMK9068)
108
+ * Fix error when params is not a hash inside `Devise::ParameterSanitizer` (by @b0nn1e)
109
+ * Look for `secret_key_base` inside `Rails.application` (by @gencer)
110
+ * Ensure `Devise::ParameterFilter` does not add missing keys when called with a hash that has a `default` / `default_proc`
111
+ configured (by @joshpencheon)
112
+ * Adds `is_navigational_format?` check to `after_sign_up_path_for` to keep consistency (by @iorme1)
113
+
114
+ ### 4.4.3 - 2018-03-17
115
+
116
+ * bug fixes
117
+ * Fix undefined method `rails5?` for Devise::Test:Module (by @tegon)
118
+ * Fix: secret key was being required to be set inside credentials on Rails 5.2 (by @tegon)
119
+
120
+ ### 4.4.2 - 2018-03-15
121
+
122
+ * enhancements
123
+ * Support for :credentials on Rails v5.2.x. (by @gencer)
124
+ * Improve documentation about the test suite. (by @tegon)
125
+ * Test with Rails 5.2.rc1 on Travis. (by @jcoyne)
126
+ * Allow test with Rails 6. (by @Fudoshiki)
127
+ * Creating a new section for controller configuration on `devise.rb` template (by @Danilo-Araujo-Silva)
128
+
129
+ * bug fixes
130
+ * Preserve content_type for unauthenticated tests (by @gmcnaughton)
131
+ * Check if the resource is persisted in `update_tracked_fields!` instead of performing validations (by @tegon)
132
+ * Revert "Replace log_process_action to append_info_to_payload" (by @tegon)
133
+
134
+ ### 4.4.1 - 2018-01-23
135
+
136
+ * bug fixes
137
+ * Ensure Gemspec is loaded as utf-8. (by @segiddins)
138
+ * Fix `ActiveRecord` check on `Confirmable`. (by @tegon)
139
+ * Fix `signed_in?` docs without running auth hooks. by (@machty)
140
+
141
+ ### 4.4.0 - 2017-12-29
142
+
143
+ * enhancements
144
+ * Add `frozen_string_literal` pragma comment to all Ruby files. (by @pat)
145
+ * Use `set_flash_method!` instead of `set_flash_method` in `Devise::OmniauthCallbacksController#failure`. (by @saichander17)
146
+ * Clarify how `store_location_for` modifies URIs. (by @olivierlacan)
147
+ * Move `failed_attempts` increment into its own function. by (@mobilutz)
148
+ * Add `autocomplete="email"` to email fields. by (@MikeRogers0)
149
+ * Add the ability to change the default migrations path introduced in Rails 5.0.3. (by @alexhifer)
150
+ * Delete unnecessary condition for helper method. (by @davydovanton)
151
+ * Support `id: :uuid` option for migrations. (by @filip373)
152
+
153
+ * bug fixes
154
+ * Fix syntax for MRI 2.5.0. (by @pat)
155
+ * Validations were being ignored on singup in the `Trackable#update_tracked_fields!` method. (by @AshleyFoster)
156
+ * Do not modify options for `#serializable_hash`. (by @guigs)
157
+ * 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)
158
+
159
+ ### 4.3.0 - 2017-05-14
160
+
161
+ * Enhancements
162
+ * Dependency support added for Rails 5.1.x.
163
+
164
+ ### 4.2.1 - 2017-03-15
165
+
166
+ * removals
167
+ * `Devise::Mailer#scope_name` and `Devise::Mailer#resource` are now protected
168
+ methods instead of public.
169
+ * bug fixes
170
+ * Attempt to reset password without the password field in the request now results in a `:blank` validation error.
171
+ Before this change, Devise would accept the reset password request and log the user in, without validating/changing
172
+ the password. (by @victor-am)
173
+ * Confirmation links now expire based on UTC time, working properly when using different timezones. (by @jjuliano)
174
+ * enhancements
175
+ * Notify the original email when it is changed with a new `Devise.send_email_changed_notification` setting.
176
+ When using `reconfirmable`, the notification will be sent right away instead of when the unconfirmed email is confirmed.
177
+ (original change by @ethirajsrinivasan)
178
+
179
+ ### 4.2.0 - 2016-07-01
180
+
181
+ * removals
182
+ * Remove the deprecated `Devise::ParameterSanitizer` API from Devise 3.
183
+ Please use the `#permit` and `#sanitize` methods over `#for`.
184
+ * Remove the deprecated OmniAuth URL helpers. Use the fully qualified helpers
185
+ (`user_facebook_omniauth_authorize_path`) over the scope based helpers
186
+ ( `user_omniauth_authorize_path(:facebook)`).
187
+ * Remove the `Devise.bcrypt` method, use `Devise::Encryptor.digest` instead.
188
+ * Remove the `Devise::Models::Confirmable#confirm!` method, use `confirm` instead.
189
+ * Remove the `Devise::Models::Recoverable#reset_password!` method, use `reset_password` instead.
190
+ * Remove the `Devise::Models::Recoverable#after_password_reset` method.
191
+ * bug fixes
192
+ * Fix an `ActionDispatch::IllegalStateError` when testing controllers with Rails 5 rc 2(by @hamadata).
193
+ * Use `ActiveSupport.on_load` hooks to include Devise on `ActiveRecord` and `Mongoid`,
194
+ avoiding autoloading these constants too soon (by @lucasmazza, @rafaelfranca).
195
+ * enhancements
196
+ * Display the minimum password length on `registrations/edit` view (by @Yanchek99).
197
+ * You can disable Devise's routes reloading on boot by through the `reload_routes = false` config.
198
+ This can reduce the time taken to boot the application but it might trigger
199
+ some errors if you application (mostly your controllers) requires that
200
+ Devise mappings be loaded during boot time (by @sidonath).
201
+ * Added `Devise::Test::IntegrationHelpers` to bypass the sign in process using
202
+ Warden test API (by @lucasmazza).
203
+ * Define `inspect` in `Devise::Models::Authenticatable` to help ensure password hashes
204
+ aren't included in exceptions or otherwise accidentally serialized (by @tkrajcar).
205
+ * Add missing support of `Rails.application.config.action_controller.relative_url_root` (by @kosdiamantis).
206
+ * deprecations
207
+ * `Devise::TestHelpers` is deprecated in favor of `Devise::Test::ControllerHelpers`
208
+ (by @lucasmazza).
209
+ * The `sign_in` test helper has changed to use keyword arguments when passing
210
+ a scope. `sign_in :admin, users(:alice)` should be rewritten as
211
+ `sign_in users(:alice), scope: :admin` (by @lucasmazza).
212
+ * The option `bypass` of `Devise::Controllers::SignInOut#sign_in` method is
213
+ deprecated in favor of `Devise::Controllers::SignInOut#bypass_sign_in`
214
+ method (by @ulissesalmeida).
215
+
1
216
  ### 4.1.1 - 2016-05-15
2
217
 
3
218
  * bug fixes
@@ -39,6 +254,11 @@
39
254
  * improvements
40
255
  * Avoids extra computation of friendly token for confirmation token (by @sbc100)
41
256
 
257
+ ### 4.0.3 - 2016-05-15
258
+
259
+ * bug fixes
260
+ * Fix overwriting the remember_token when a valid one already exists (by @ralinchimev).
261
+
42
262
  ### 4.0.2 - 2016-05-02
43
263
 
44
264
  * bug fixes
@@ -82,11 +302,11 @@
82
302
 
83
303
  * deprecations
84
304
  * omniauth routes are no longer defined with a wildcard `:provider` parameter,
85
- and provider specific routes are defined instead, so route helpers like `user_omniauth_authorize_path(:github)` are deprecated in favor of `user_github_authorize_path`.
305
+ 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`.
86
306
  You can still use `omniauth_authorize_path(:user, :github)` if you need to
87
307
  call the helpers dynamically.
88
308
 
89
- ### 4.0.0.rc1 - 2016-01-02
309
+ ### 4.0.0.rc1 - 2016-02-01
90
310
 
91
311
  * Support added to Rails 5 (by @twalpole).
92
312
  * Devise no longer supports Rails 3.2 and 4.0.
@@ -124,8 +344,8 @@
124
344
  end
125
345
  ```
126
346
 
127
- You can check more examples and explanations on the [README section](/plataformatec/devise#strong-parameters)
347
+ You can check more examples and explanations on the [README section](README.md#strong-parameters)
128
348
  and on the [ParameterSanitizer docs](lib/devise/parameter_sanitizer.rb).
129
349
 
130
- Please check [3-stable](https://github.com/plataformatec/devise/blob/3-stable/CHANGELOG.md)
350
+ Please check [3-stable](https://github.com/heartcombo/devise/blob/3-stable/CHANGELOG.md)
131
351
  for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,5 @@
1
- Copyright 2009-2016 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,6 @@
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
+ [![Code Climate](https://codeclimate.com/github/heartcombo/devise.svg)](https://codeclimate.com/github/heartcombo/devise)
9
4
 
10
5
  Devise is a flexible authentication solution for Rails based on Warden. It:
11
6
 
@@ -16,16 +11,55 @@ Devise is a flexible authentication solution for Rails based on Warden. It:
16
11
 
17
12
  It's composed of 10 modules:
18
13
 
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/intridea/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.
14
+ * [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.
15
+ * [Omniauthable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support.
16
+ * [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.
17
+ * [Recoverable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions.
18
+ * [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.
19
+ * [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.
20
+ * [Trackable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address.
21
+ * [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.
22
+ * [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.
23
+ * [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.
24
+
25
+ ## Table of Contents
26
+
27
+ <!-- TOC depthFrom:1 depthTo:6 withLinks:1 orderedList:0 -->
28
+
29
+ - [Information](#information)
30
+ - [The Devise wiki](#the-devise-wiki)
31
+ - [Bug reports](#bug-reports)
32
+ - [StackOverflow and Mailing List](#stackoverflow-and-mailing-list)
33
+ - [RDocs](#rdocs)
34
+ - [Example applications](#example-applications)
35
+ - [Extensions](#extensions)
36
+ - [Contributing](#contributing)
37
+ - [Starting with Rails?](#starting-with-rails)
38
+ - [Getting started](#getting-started)
39
+ - [Controller filters and helpers](#controller-filters-and-helpers)
40
+ - [Configuring Models](#configuring-models)
41
+ - [Strong Parameters](#strong-parameters)
42
+ - [Configuring views](#configuring-views)
43
+ - [Configuring controllers](#configuring-controllers)
44
+ - [Configuring routes](#configuring-routes)
45
+ - [I18n](#i18n)
46
+ - [Test helpers](#test-helpers)
47
+ - [Controller tests](#controller-tests)
48
+ - [Integration tests](#integration-tests)
49
+ - [OmniAuth](#omniauth)
50
+ - [Configuring multiple models](#configuring-multiple-models)
51
+ - [ActiveJob Integration](#activejob-integration)
52
+ - [Password reset tokens and Rails logs](#password-reset-tokens-and-rails-logs)
53
+ - [Other ORMs](#other-orms)
54
+ - [Rails API mode](#rails-api-mode)
55
+ - [Additional information](#additional-information)
56
+ - [Warden](#warden)
57
+ - [Contributors](#contributors)
58
+ - [License](#license)
59
+
60
+ <!-- /TOC -->
61
+
62
+
29
63
 
30
64
  ## Information
31
65
 
@@ -33,19 +67,23 @@ It's composed of 10 modules:
33
67
 
34
68
  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:
35
69
 
36
- https://github.com/plataformatec/devise/wiki
70
+ https://github.com/heartcombo/devise/wiki
37
71
 
38
72
  ### Bug reports
39
73
 
40
74
  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:
41
75
 
42
- https://github.com/plataformatec/devise/wiki/Bug-reports
76
+ https://github.com/heartcombo/devise/wiki/Bug-reports
77
+
78
+ If you have discovered a security related bug, please do *NOT* use the GitHub issue tracker. Send an email to heartcombo@googlegroups.com.
79
+
80
+ ### StackOverflow and Mailing List
43
81
 
44
- If you have discovered a security related bug, please do *NOT* use the GitHub issue tracker. Send an email to opensource@plataformatec.com.br.
82
+ If you have any questions, comments, or concerns, please use StackOverflow instead of the GitHub issue tracker:
45
83
 
46
- ### Mailing list
84
+ http://stackoverflow.com/questions/tagged/devise
47
85
 
48
- If you have any questions, comments, or concerns, please use the Google Group instead of the GitHub issue tracker:
86
+ The deprecated mailing list can still be read on
49
87
 
50
88
  https://groups.google.com/group/plataformatec-devise
51
89
 
@@ -53,7 +91,7 @@ https://groups.google.com/group/plataformatec-devise
53
91
 
54
92
  You can view the Devise documentation in RDoc format here:
55
93
 
56
- http://rubydoc.info/github/plataformatec/devise/master/frames
94
+ http://rubydoc.info/github/heartcombo/devise/master/frames
57
95
 
58
96
  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.
59
97
 
@@ -61,65 +99,115 @@ If you need to use Devise with previous versions of Rails, you can always run "g
61
99
 
62
100
  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:
63
101
 
64
- https://github.com/plataformatec/devise/wiki/Example-Applications
102
+ https://github.com/heartcombo/devise/wiki/Example-Applications
65
103
 
66
104
  ### Extensions
67
105
 
68
106
  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:
69
107
 
70
- https://github.com/plataformatec/devise/wiki/Extensions
108
+ https://github.com/heartcombo/devise/wiki/Extensions
71
109
 
72
110
  ### Contributing
73
111
 
74
112
  We hope that you will consider contributing to Devise. Please read this short overview for some information about how to get started:
75
113
 
76
- https://github.com/plataformatec/devise/wiki/Contributing
114
+ https://github.com/heartcombo/devise/wiki/Contributing
115
+
116
+ 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`.
117
+ 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`.
118
+
119
+ ### DEVISE_ORM
120
+ Since Devise supports both Mongoid and ActiveRecord, we rely on this variable to run specific code for each ORM.
121
+ The default value of `DEVISE_ORM` is `active_record`. To run the tests for Mongoid, you can pass `mongoid`:
122
+ ```
123
+ DEVISE_ORM=mongoid bin/test
124
+
125
+ ==> Devise.orm = :mongoid
126
+ ```
127
+ When running the tests for Mongoid, you will need to have a MongoDB server (version 2.0 or newer) running on your system.
128
+
129
+ Please note that the command output will show the variable value being used.
130
+
131
+ ### BUNDLE_GEMFILE
132
+ We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory).
133
+ 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 using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable.
134
+ For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following:
135
+ ```bash
136
+ rbenv shell 2.4.2 # or rvm use 2.4.2
137
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bundle install
138
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bin/test
139
+ ```
140
+
141
+ You can also combine both of them if the tests broke for Mongoid:
142
+ ```bash
143
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bundle install
144
+ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable DEVISE_ORM=mongoid bin/test
145
+ ```
146
+
147
+ ### Running tests
148
+ Devise uses [Mini Test](https://github.com/seattlerb/minitest) as test framework.
77
149
 
78
- 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.
150
+ * Running all tests:
151
+ ```bash
152
+ bin/test
153
+ ```
154
+
155
+ * Running tests for an specific file:
156
+ ```bash
157
+ bin/test test/models/trackable_test.rb
158
+ ```
159
+
160
+ * Running a specific test given a regex:
161
+ ```bash
162
+ bin/test test/models/trackable_test.rb:16
163
+ ```
79
164
 
80
165
  ## Starting with Rails?
81
166
 
82
- 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:
167
+ 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:
83
168
 
84
169
  * Michael Hartl's online book: https://www.railstutorial.org/book/modeling_users
85
- * Ryan Bates' Railscast: http://railscasts.com/episodes/250-authentication-from-scratch
86
- * Codecademy's Ruby on Rails: Authentication and Authorization: http://www.codecademy.com/en/learn/rails-auth
170
+ * Ryan Bates' Railscasts: http://railscasts.com/episodes/250-authentication-from-scratch and http://railscasts.com/episodes/250-authentication-from-scratch-revised
171
+ * Codecademy's Ruby on Rails: Authentication and Authorization: https://www.codecademy.com/learn/rails-auth
87
172
 
88
173
  Once you have solidified your understanding of Rails and authentication mechanisms, we assure you Devise will be very pleasant to work with. :smiley:
89
174
 
90
175
  ## Getting started
91
176
 
92
- Devise 4.0 works with Rails 4.2 onwards. You can add it to your Gemfile with:
177
+ Devise 4.0 works with Rails 4.1 onwards. Add the following line to your Gemfile:
93
178
 
94
179
  ```ruby
95
180
  gem 'devise'
96
181
  ```
97
182
 
98
- Run the bundle command to install it.
183
+ Then run `bundle install`
99
184
 
100
- After you install Devise and add it to your Gemfile, you need to run the generator:
185
+ Next, you need to run the generator:
101
186
 
102
187
  ```console
103
- rails generate devise:install
188
+ $ rails generate devise:install
104
189
  ```
105
190
 
106
- The generator will install an initializer which describes ALL of Devise's configuration options. It is *imperative* that you take a look at it. When you are done, you are ready to add Devise to any of your models using the generator:
191
+ At this point, a number of instructions will appear in the console. Among these instructions, you'll need to set up the default URL options for the Devise mailer in each environment. Here is a possible configuration for `config/environments/development.rb`:
107
192
 
108
- ```console
109
- rails generate devise MODEL
193
+ ```ruby
194
+ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
110
195
  ```
111
196
 
112
- Replace MODEL with the class name used for the application’s users (it’s frequently `User` but could also be `Admin`). This will create a model (if one does not exist) and configure it with the default Devise modules. The generator also configures your `config/routes.rb` file to point to the Devise controller.
197
+ The generator will install an initializer which describes ALL of Devise's configuration options. It is *imperative* that you take a look at it. When you are done, you are ready to add Devise to any of your models using the generator.
113
198
 
114
- 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. Then run `rake db:migrate`
115
199
 
116
- Next, you need to set up the default URL options for the Devise mailer in each environment. Here is a possible configuration for `config/environments/development.rb`:
200
+ In the following command you will replace `MODEL` with the class name used for the application’s users (it’s frequently `User` but could also be `Admin`). This will create a model (if one does not exist) and configure it with the default Devise modules. The generator also configures your `config/routes.rb` file to point to the Devise controller.
117
201
 
118
- ```ruby
119
- config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
202
+ ```console
203
+ $ rails generate devise MODEL
120
204
  ```
121
205
 
122
- You should restart your application after changing Devise's configuration options. Otherwise, you will run into strange errors, for example, users being unable to login and route helpers being undefined.
206
+ 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
+
208
+ Then run `rails db:migrate`
209
+
210
+ You should restart your application after changing Devise's configuration options (this includes stopping spring). Otherwise, you will run into strange errors, for example, users being unable to login and route helpers being undefined.
123
211
 
124
212
  ### Controller filters and helpers
125
213
 
@@ -154,7 +242,7 @@ user_session
154
242
  After signing in a user, confirming the account or updating the password, Devise will look for a scoped root path to redirect to. For instance, when using a `:user` resource, the `user_root_path` will be used if it exists; otherwise, the default `root_path` will be used. This means that you need to set the root inside your routes:
155
243
 
156
244
  ```ruby
157
- root to: "home#index"
245
+ root to: 'home#index'
158
246
  ```
159
247
 
160
248
  You can also override `after_sign_in_path_for` and `after_sign_out_path_for` to customize your redirect hooks.
@@ -176,16 +264,16 @@ member_session
176
264
  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:
177
265
 
178
266
  ```ruby
179
- devise :database_authenticatable, :registerable, :confirmable, :recoverable, stretches: 20
267
+ devise :database_authenticatable, :registerable, :confirmable, :recoverable, stretches: 13
180
268
  ```
181
269
 
182
270
  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`.
183
271
 
184
272
  ### Strong Parameters
185
273
 
186
- ![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)
274
+ The Parameter Sanitizer API has changed for Devise 4 :warning:
187
275
 
188
- *For previous Devise versions see https://github.com/plataformatec/devise/tree/3-stable#strong-parameters*
276
+ *For previous Devise versions see https://github.com/heartcombo/devise/tree/3-stable#strong-parameters*
189
277
 
190
278
  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.
191
279
 
@@ -195,7 +283,7 @@ There are just three actions in Devise that allow any set of parameters to be pa
195
283
  * `sign_up` (`Devise::RegistrationsController#create`) - Permits authentication keys plus `password` and `password_confirmation`
196
284
  * `account_update` (`Devise::RegistrationsController#update`) - Permits authentication keys plus `password`, `password_confirmation` and `current_password`
197
285
 
198
- In case you want to permit additional parameters (the lazy way™), you can do so using a simple before filter in your `ApplicationController`:
286
+ In case you want to permit additional parameters (the lazy way™), you can do so using a simple before action in your `ApplicationController`:
199
287
 
200
288
  ```ruby
201
289
  class ApplicationController < ActionController::Base
@@ -209,7 +297,21 @@ class ApplicationController < ActionController::Base
209
297
  end
210
298
  ```
211
299
 
212
- The above works for any additional fields where the parameters are simple scalar types. If you have nested attributes (say you're using `accepts_nested_attributes_for`), then you will need to tell devise about those nestings and types. Devise allows you to completely change Devise defaults or invoke custom behaviour by passing a block:
300
+ The above works for any additional fields where the parameters are simple scalar types. If you have nested attributes (say you're using `accepts_nested_attributes_for`), then you will need to tell devise about those nestings and types:
301
+
302
+ ```ruby
303
+ class ApplicationController < ActionController::Base
304
+ before_action :configure_permitted_parameters, if: :devise_controller?
305
+
306
+ protected
307
+
308
+ def configure_permitted_parameters
309
+ devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, address_attributes: [:country, :state, :city, :area, :postal_code]])
310
+ end
311
+ end
312
+ ```
313
+
314
+ Devise allows you to completely change Devise defaults or invoke custom behavior by passing a block:
213
315
 
214
316
  To permit simple scalar values for username and email, use this
215
317
 
@@ -270,7 +372,7 @@ We built Devise to help you quickly develop an application that uses authenticat
270
372
  Since Devise is an engine, all its views are packaged inside the gem. These views will help you get started, but after some time you may want to change them. If this is the case, you just need to invoke the following generator, and it will copy all views to your application:
271
373
 
272
374
  ```console
273
- rails generate devise:views
375
+ $ rails generate devise:views
274
376
  ```
275
377
 
276
378
  If you have more than one Devise model in your application (such as `User` and `Admin`), you will notice that Devise uses the same views for all models. Fortunately, Devise offers an easy way to customize views. All you need to do is set `config.scoped_views = true` inside the `config/initializers/devise.rb` file.
@@ -278,14 +380,14 @@ If you have more than one Devise model in your application (such as `User` and `
278
380
  After doing so, you will be able to have views based on the role like `users/sessions/new` and `admins/sessions/new`. If no view is found within the scope, Devise will use the default view at `devise/sessions/new`. You can also use the generator to generate scoped views:
279
381
 
280
382
  ```console
281
- rails generate devise:views users
383
+ $ rails generate devise:views users
282
384
  ```
283
385
 
284
386
  If you would like to generate only a few sets of views, like the ones for the `registerable` and `confirmable` module,
285
387
  you can pass a list of modules to the generator with the `-v` flag.
286
388
 
287
389
  ```console
288
- rails generate devise:views -v registrations confirmations
390
+ $ rails generate devise:views -v registrations confirmations
289
391
  ```
290
392
 
291
393
  ### Configuring controllers
@@ -295,7 +397,7 @@ If the customization at the views level is not enough, you can customize each co
295
397
  1. Create your custom controllers using the generator which requires a scope:
296
398
 
297
399
  ```console
298
- rails generate devise:controllers [scope]
400
+ $ rails generate devise:controllers [scope]
299
401
  ```
300
402
 
301
403
  If you specify `users` as the scope, controllers will be created in `app/controllers/users/`.
@@ -310,11 +412,12 @@ If the customization at the views level is not enough, you can customize each co
310
412
  ...
311
413
  end
312
414
  ```
415
+ (Use the -c flag to specify a controller, for example: `rails generate devise:controllers users -c=sessions`)
313
416
 
314
417
  2. Tell the router to use this controller:
315
418
 
316
419
  ```ruby
317
- devise_for :users, controllers: { sessions: "users/sessions" }
420
+ devise_for :users, controllers: { sessions: 'users/sessions' }
318
421
  ```
319
422
 
320
423
  3. Copy the views from `devise/sessions` to `users/sessions`. Since the controller was changed, it won't use the default views located in `devise/sessions`.
@@ -331,7 +434,7 @@ If the customization at the views level is not enough, you can customize each co
331
434
  end
332
435
  ```
333
436
 
334
- Or you can simply add new behaviour to it:
437
+ Or you can simply add new behavior to it:
335
438
 
336
439
  ```ruby
337
440
  class Users::SessionsController < Devise::SessionsController
@@ -352,21 +455,27 @@ Remember that Devise uses flash messages to let users know if sign in was succes
352
455
  Devise also ships with default routes. If you need to customize them, you should probably be able to do it through the devise_for method. It accepts several options like :class_name, :path_prefix and so on, including the possibility to change path names for I18n:
353
456
 
354
457
  ```ruby
355
- 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' }
458
+ 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' }
356
459
  ```
357
460
 
358
- Be sure to check `devise_for` [documentation](http://www.rubydoc.info/github/plataformatec/devise/master/ActionDispatch/Routing/Mapper%3Adevise_for) for details.
461
+ Be sure to check `devise_for` [documentation](http://www.rubydoc.info/github/heartcombo/devise/master/ActionDispatch/Routing/Mapper%3Adevise_for) for details.
359
462
 
360
463
  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:
361
464
 
362
465
  ```ruby
363
466
  devise_scope :user do
364
- get "sign_in", to: "devise/sessions#new"
467
+ get 'sign_in', to: 'devise/sessions#new'
365
468
  end
366
469
  ```
367
470
 
368
471
  This way, you tell Devise to use the scope `:user` when "/sign_in" is accessed. Notice `devise_scope` is also aliased as `as` in your router.
369
472
 
473
+ Please note: You will still need to add `devise_for` in your routes in order to use helper methods such as `current_user`.
474
+
475
+ ```ruby
476
+ devise_for :users, skip: :all
477
+ ```
478
+
370
479
  ### I18n
371
480
 
372
481
  Devise uses flash messages with I18n, in conjunction with the flash keys :notice and :alert. To customize your app, you can set up your locale file:
@@ -405,55 +514,113 @@ en:
405
514
 
406
515
  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:
407
516
 
408
- https://github.com/plataformatec/devise/wiki/I18n
517
+ https://github.com/heartcombo/devise/wiki/I18n
409
518
 
410
519
  Caution: Devise Controllers inherit from ApplicationController. If your app uses multiple locales, you should be sure to set I18n.locale in ApplicationController.
411
520
 
412
521
  ### Test helpers
413
522
 
414
- Devise includes some test helpers for functional specs. In order to use them, you need to include Devise in your functional tests by adding the following to the bottom of your `test/test_helper.rb` file (make sure you place it out of scope of `ActiveSupport::TestCase` which is the default class inside of `test/test_helper.rb`):
523
+ Devise includes some test helpers for controller and integration tests.
524
+ In order to use them, you need to include the respective module in your test
525
+ cases/specs.
526
+
527
+ ### Controller tests
528
+
529
+ Controller tests require that you include `Devise::Test::IntegrationHelpers` on
530
+ your test case or its parent `ActionController::TestCase` superclass.
531
+ For Rails versions prior to 5, include `Devise::Test::ControllerHelpers` instead, since the superclass
532
+ for controller tests was changed to ActionDispatch::IntegrationTest
533
+ (for more details, see the [Integration tests](#integration-tests) section).
415
534
 
416
535
  ```ruby
417
- class ActionController::TestCase
418
- include Devise::TestHelpers
536
+ class PostsControllerTest < ActionController::TestCase
537
+ include Devise::Test::IntegrationHelpers # Rails >= 5
419
538
  end
420
539
  ```
421
540
 
422
- If you're using RSpec, you can put the following inside a file named `spec/support/devise.rb` or in your `spec/spec_helper.rb` (or `spec/rails_helper.rb` if you are using rspec-rails):
541
+ ```ruby
542
+ class PostsControllerTest < ActionController::TestCase
543
+ include Devise::Test::ControllerHelpers # Rails < 5
544
+ end
545
+ ```
546
+
547
+ If you're using RSpec, you can put the following inside a file named
548
+ `spec/support/devise.rb` or in your `spec/spec_helper.rb` (or
549
+ `spec/rails_helper.rb` if you are using `rspec-rails`):
423
550
 
424
551
  ```ruby
425
552
  RSpec.configure do |config|
426
- config.include Devise::TestHelpers, type: :controller
427
- config.include Devise::TestHelpers, type: :view
553
+ config.include Devise::Test::ControllerHelpers, type: :controller
554
+ config.include Devise::Test::ControllerHelpers, type: :view
428
555
  end
429
556
  ```
430
557
 
431
558
  Just be sure that this inclusion is made *after* the `require 'rspec/rails'` directive.
432
559
 
433
- Now you are ready to use the `sign_in` and `sign_out` methods. Such methods have the same signature as in controllers:
560
+ Now you are ready to use the `sign_in` and `sign_out` methods on your controller
561
+ tests:
434
562
 
435
563
  ```ruby
436
- sign_in :user, @user # sign_in(scope, resource)
437
- sign_in @user # sign_in(resource)
564
+ sign_in @user
565
+ sign_in @user, scope: :admin
566
+ ```
567
+
568
+ If you are testing Devise internal controllers or a controller that inherits
569
+ from Devise's, you need to tell Devise which mapping should be used before a
570
+ request. This is necessary because Devise gets this information from the router,
571
+ but since controller tests do not pass through the router, it needs to be stated
572
+ explicitly. For example, if you are testing the user scope, simply use:
438
573
 
439
- sign_out :user # sign_out(scope)
440
- sign_out @user # sign_out(resource)
574
+ ```ruby
575
+ test 'GET new' do
576
+ # Mimic the router behavior of setting the Devise scope through the env.
577
+ @request.env['devise.mapping'] = Devise.mappings[:user]
578
+
579
+ # Use the sign_in helper to sign in a fixture `User` record.
580
+ sign_in users(:alice)
581
+
582
+ get :new
583
+
584
+ # assert something
585
+ end
441
586
  ```
442
587
 
443
- There are two things that are important to keep in mind:
588
+ ### Integration tests
444
589
 
445
- 1. These helpers are not going to work for integration tests driven by Capybara or Webrat. They are meant to be used with functional tests only. It is undesirable even to include `Devise::TestHelpers` during integration tests. Instead, fill in the form or explicitly set the user in session;
590
+ Integration test helpers are available by including the
591
+ `Devise::Test::IntegrationHelpers` module.
446
592
 
447
- 2. If you are testing Devise internal controllers or a controller that inherits from Devise's, you need to tell Devise which mapping should be used before a request. This is necessary because Devise gets this information from the router, but since functional tests do not pass through the router, it needs to be stated explicitly. For example, if you are testing the user scope, simply use:
593
+ ```ruby
594
+ class PostsTests < ActionDispatch::IntegrationTest
595
+ include Devise::Test::IntegrationHelpers
596
+ end
597
+ ```
448
598
 
449
- ```ruby
450
- @request.env["devise.mapping"] = Devise.mappings[:user]
451
- get :new
452
- ```
599
+ Now you can use the following `sign_in` and `sign_out` methods in your integration
600
+ tests:
601
+
602
+ ```ruby
603
+ sign_in users(:bob)
604
+ sign_in users(:bob), scope: :admin
605
+
606
+ sign_out :user
607
+ ```
608
+
609
+ RSpec users can include the `IntegrationHelpers` module on their `:feature` specs.
610
+
611
+ ```ruby
612
+ RSpec.configure do |config|
613
+ config.include Devise::Test::IntegrationHelpers, type: :feature
614
+ end
615
+ ```
616
+
617
+ Unlike controller tests, integration tests do not need to supply the
618
+ `devise.mapping` `env` value, as the mapping can be inferred by the routes that
619
+ are executed in your tests.
453
620
 
454
621
  You can read more about testing your Rails 3 - Rails 4 controllers with RSpec in the wiki:
455
622
 
456
- * https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-%28and-RSpec%29
623
+ * https://github.com/heartcombo/devise/wiki/How-To:-Test-controllers-with-Rails-(and-RSpec)
457
624
 
458
625
  ### OmniAuth
459
626
 
@@ -465,7 +632,7 @@ config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
465
632
 
466
633
  You can read more about OmniAuth support in the wiki:
467
634
 
468
- * https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
635
+ * https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview
469
636
 
470
637
  ### Configuring multiple models
471
638
 
@@ -512,12 +679,12 @@ end
512
679
 
513
680
  ### Password reset tokens and Rails logs
514
681
 
515
- 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:
682
+ 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:
516
683
 
517
684
  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.
518
685
  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.
519
686
 
520
- Rails sets the production logger level to DEBUG by default. Consider changing your production logger level to WARN if you wish to prevent tokens from being leaked into your logs. In `config/environments/production.rb`:
687
+ Rails sets the production logger level to INFO by default. Consider changing your production logger level to WARN if you wish to prevent tokens from being leaked into your logs. In `config/environments/production.rb`:
521
688
 
522
689
  ```ruby
523
690
  config.log_level = :warn
@@ -528,32 +695,50 @@ config.log_level = :warn
528
695
 
529
696
  Devise supports ActiveRecord (default) and Mongoid. To select another ORM, simply require it in the initializer file.
530
697
 
531
- ## Additional information
698
+ ### Rails API Mode
699
+
700
+ 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/))
701
+
702
+ #### Supported Authentication Strategies
703
+ 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))
704
+
705
+ The devise default for HTTP Auth is disabled, so it will need to be enabled in the devise initializer for the database strategy:
706
+
707
+ ```ruby
708
+ config.http_authenticatable = [:database]
709
+ ```
532
710
 
533
- ### Heroku
711
+ This restriction does not limit you from implementing custom warden strategies, either in your application or via gem-based extensions for devise.
712
+ 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/).
534
713
 
535
- Using Devise on Heroku with Ruby on Rails 3.2 requires setting:
714
+ #### Testing
715
+ 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:
536
716
 
537
717
  ```ruby
538
- config.assets.initialize_on_precompile = false
718
+ Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Cookies
719
+ Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Session::CookieStore
539
720
  ```
540
721
 
541
- Read more about the potential issues at http://guides.rubyonrails.org/asset_pipeline.html
722
+ For a deeper understanding of this, review [this issue](https://github.com/heartcombo/devise/issues/4696).
723
+
724
+ Additionally be mindful that without views supported, some email-based flows from Confirmable, Recoverable and Lockable are not supported directly at this time.
725
+
726
+ ## Additional information
542
727
 
543
728
  ### Warden
544
729
 
545
730
  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:
546
731
 
547
- https://github.com/hassox/warden
732
+ https://github.com/wardencommunity/warden
548
733
 
549
734
  ### Contributors
550
735
 
551
736
  We have a long list of valued contributors. Check them all at:
552
737
 
553
- https://github.com/plataformatec/devise/graphs/contributors
738
+ https://github.com/heartcombo/devise/graphs/contributors
554
739
 
555
740
  ## License
556
741
 
557
- MIT License. Copyright 2009-2016 Plataformatec. http://plataformatec.com.br
742
+ MIT License. Copyright 2020 Rafael França, Leonardo Tegon, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
558
743
 
559
- You are not granted rights or licenses to the trademarks of Plataformatec, including without limitation the Devise name or logo.
744
+ The Devise logo is licensed under [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).