devise_token_auth 1.0.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +6 -3
  3. data/app/controllers/devise_token_auth/application_controller.rb +23 -3
  4. data/app/controllers/devise_token_auth/concerns/resource_finder.rb +24 -11
  5. data/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +78 -57
  6. data/app/controllers/devise_token_auth/confirmations_controller.rb +69 -19
  7. data/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +89 -44
  8. data/app/controllers/devise_token_auth/passwords_controller.rb +55 -31
  9. data/app/controllers/devise_token_auth/registrations_controller.rb +33 -40
  10. data/app/controllers/devise_token_auth/sessions_controller.rb +36 -14
  11. data/app/controllers/devise_token_auth/unlocks_controller.rb +12 -7
  12. data/app/models/devise_token_auth/concerns/active_record_support.rb +14 -0
  13. data/app/models/devise_token_auth/concerns/confirmable_support.rb +28 -0
  14. data/app/models/devise_token_auth/concerns/mongoid_support.rb +19 -0
  15. data/app/models/devise_token_auth/concerns/tokens_serialization.rb +31 -0
  16. data/app/models/devise_token_auth/concerns/user.rb +79 -80
  17. data/app/models/devise_token_auth/concerns/user_omniauth_callbacks.rb +12 -5
  18. data/app/validators/{email_validator.rb → devise_token_auth_email_validator.rb} +11 -3
  19. data/app/views/devise_token_auth/omniauth_external_window.html.erb +1 -1
  20. data/config/locales/da-DK.yml +2 -0
  21. data/config/locales/de.yml +2 -0
  22. data/config/locales/en.yml +10 -0
  23. data/config/locales/es.yml +2 -0
  24. data/config/locales/fr.yml +2 -0
  25. data/config/locales/he.yml +52 -0
  26. data/config/locales/it.yml +2 -0
  27. data/config/locales/ja.yml +16 -2
  28. data/config/locales/ko.yml +51 -0
  29. data/config/locales/nl.yml +2 -0
  30. data/config/locales/pl.yml +6 -3
  31. data/config/locales/pt-BR.yml +2 -0
  32. data/config/locales/pt.yml +6 -3
  33. data/config/locales/ro.yml +2 -0
  34. data/config/locales/ru.yml +2 -0
  35. data/config/locales/sq.yml +2 -0
  36. data/config/locales/sv.yml +2 -0
  37. data/config/locales/uk.yml +2 -0
  38. data/config/locales/vi.yml +2 -0
  39. data/config/locales/zh-CN.yml +2 -0
  40. data/config/locales/zh-HK.yml +2 -0
  41. data/config/locales/zh-TW.yml +2 -0
  42. data/lib/devise_token_auth/blacklist.rb +6 -0
  43. data/lib/devise_token_auth/controllers/helpers.rb +5 -9
  44. data/lib/devise_token_auth/engine.rb +17 -2
  45. data/lib/devise_token_auth/rails/routes.rb +22 -16
  46. data/lib/devise_token_auth/token_factory.rb +126 -0
  47. data/lib/devise_token_auth/url.rb +3 -0
  48. data/lib/devise_token_auth/version.rb +1 -1
  49. data/lib/devise_token_auth.rb +6 -3
  50. data/lib/generators/devise_token_auth/USAGE +1 -1
  51. data/lib/generators/devise_token_auth/install_generator.rb +7 -91
  52. data/lib/generators/devise_token_auth/install_generator_helpers.rb +98 -0
  53. data/lib/generators/devise_token_auth/install_mongoid_generator.rb +46 -0
  54. data/lib/generators/devise_token_auth/templates/devise_token_auth.rb +21 -5
  55. data/lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb +1 -8
  56. data/lib/generators/devise_token_auth/templates/user.rb.erb +2 -2
  57. data/lib/generators/devise_token_auth/templates/user_mongoid.rb.erb +56 -0
  58. data/test/controllers/custom/custom_confirmations_controller_test.rb +2 -2
  59. data/test/controllers/custom/custom_omniauth_callbacks_controller_test.rb +1 -1
  60. data/test/controllers/demo_mang_controller_test.rb +37 -8
  61. data/test/controllers/demo_user_controller_test.rb +39 -10
  62. data/test/controllers/devise_token_auth/confirmations_controller_test.rb +170 -22
  63. data/test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb +117 -53
  64. data/test/controllers/devise_token_auth/passwords_controller_test.rb +299 -122
  65. data/test/controllers/devise_token_auth/registrations_controller_test.rb +56 -16
  66. data/test/controllers/devise_token_auth/sessions_controller_test.rb +139 -75
  67. data/test/controllers/devise_token_auth/token_validations_controller_test.rb +43 -2
  68. data/test/controllers/devise_token_auth/unlocks_controller_test.rb +44 -5
  69. data/test/controllers/overrides/confirmations_controller_test.rb +1 -1
  70. data/test/controllers/overrides/omniauth_callbacks_controller_test.rb +1 -1
  71. data/test/dummy/app/active_record/confirmable_user.rb +11 -0
  72. data/test/dummy/app/{models → active_record}/scoped_user.rb +2 -2
  73. data/test/dummy/app/{models → active_record}/unconfirmable_user.rb +1 -2
  74. data/test/dummy/app/{models → active_record}/unregisterable_user.rb +3 -3
  75. data/test/dummy/app/active_record/user.rb +6 -0
  76. data/test/dummy/app/controllers/application_controller.rb +2 -6
  77. data/test/dummy/app/controllers/overrides/confirmations_controller.rb +5 -4
  78. data/test/dummy/app/controllers/overrides/passwords_controller.rb +5 -4
  79. data/test/dummy/app/controllers/overrides/registrations_controller.rb +1 -1
  80. data/test/dummy/app/controllers/overrides/sessions_controller.rb +2 -2
  81. data/test/dummy/app/models/{user.rb → concerns/favorite_color.rb} +7 -8
  82. data/test/dummy/app/mongoid/confirmable_user.rb +52 -0
  83. data/test/dummy/app/mongoid/lockable_user.rb +38 -0
  84. data/test/dummy/app/mongoid/mang.rb +46 -0
  85. data/test/dummy/app/mongoid/only_email_user.rb +33 -0
  86. data/test/dummy/app/mongoid/scoped_user.rb +50 -0
  87. data/test/dummy/app/mongoid/unconfirmable_user.rb +44 -0
  88. data/test/dummy/app/mongoid/unregisterable_user.rb +47 -0
  89. data/test/dummy/app/mongoid/user.rb +49 -0
  90. data/test/dummy/app/views/layouts/application.html.erb +0 -2
  91. data/test/dummy/config/application.rb +22 -1
  92. data/test/dummy/config/boot.rb +4 -0
  93. data/test/dummy/config/environments/development.rb +0 -10
  94. data/test/dummy/config/environments/production.rb +0 -16
  95. data/test/dummy/config/environments/test.rb +6 -2
  96. data/test/dummy/config/initializers/devise.rb +285 -0
  97. data/test/dummy/config/initializers/devise_token_auth.rb +35 -4
  98. data/test/dummy/config/initializers/figaro.rb +1 -1
  99. data/test/dummy/config/initializers/omniauth.rb +1 -0
  100. data/test/dummy/config/routes.rb +2 -0
  101. data/test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb +0 -7
  102. data/test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb +0 -7
  103. data/test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb +0 -7
  104. data/test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb +0 -7
  105. data/test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb +0 -7
  106. data/test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb +0 -7
  107. data/test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb +0 -7
  108. data/test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb +49 -0
  109. data/test/dummy/db/schema.rb +31 -33
  110. data/test/dummy/tmp/generators/app/models/user.rb +9 -0
  111. data/test/dummy/tmp/generators/config/initializers/devise_token_auth.rb +66 -0
  112. data/test/dummy/tmp/generators/db/migrate/20230415183419_devise_token_auth_create_users.rb +49 -0
  113. data/test/factories/users.rb +3 -2
  114. data/test/lib/devise_token_auth/blacklist_test.rb +19 -0
  115. data/test/lib/devise_token_auth/rails/custom_routes_test.rb +29 -0
  116. data/test/lib/devise_token_auth/rails/routes_test.rb +87 -0
  117. data/test/lib/devise_token_auth/token_factory_test.rb +191 -0
  118. data/test/lib/devise_token_auth/url_test.rb +2 -2
  119. data/test/lib/generators/devise_token_auth/install_generator_test.rb +51 -31
  120. data/test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb +51 -31
  121. data/test/models/concerns/mongoid_support_test.rb +31 -0
  122. data/test/models/concerns/tokens_serialization_test.rb +104 -0
  123. data/test/models/confirmable_user_test.rb +35 -0
  124. data/test/models/only_email_user_test.rb +0 -8
  125. data/test/models/user_test.rb +13 -23
  126. data/test/test_helper.rb +45 -4
  127. metadata +190 -97
  128. data/config/initializers/devise.rb +0 -198
  129. data/test/dummy/config/initializers/assets.rb +0 -10
  130. data/test/dummy/tmp/generators/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  131. data/test/dummy/tmp/generators/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
  132. /data/test/dummy/app/{models → active_record}/lockable_user.rb +0 -0
  133. /data/test/dummy/app/{models → active_record}/mang.rb +0 -0
  134. /data/test/dummy/app/{models → active_record}/only_email_user.rb +0 -0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lynn Hurley
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2023-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 4.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 4.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: devise
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 3.5.2
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '4.6'
42
+ version: '5'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,21 @@ dependencies:
49
49
  version: 3.5.2
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '4.6'
52
+ version: '5'
53
+ - !ruby/object:Gem::Dependency
54
+ name: bcrypt
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '3.0'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3.0'
53
67
  - !ruby/object:Gem::Dependency
54
68
  name: appraisal
55
69
  requirement: !ruby/object:Gem::Requirement
@@ -70,14 +84,14 @@ dependencies:
70
84
  requirements:
71
85
  - - "~>"
72
86
  - !ruby/object:Gem::Version
73
- version: '1.3'
87
+ version: '1.4'
74
88
  type: :development
75
89
  prerelease: false
76
90
  version_requirements: !ruby/object:Gem::Requirement
77
91
  requirements:
78
92
  - - "~>"
79
93
  - !ruby/object:Gem::Version
80
- version: '1.3'
94
+ version: '1.4'
81
95
  - !ruby/object:Gem::Dependency
82
96
  name: pg
83
97
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +120,40 @@ dependencies:
106
120
  - - ">="
107
121
  - !ruby/object:Gem::Version
108
122
  version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: mongoid
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '4'
130
+ - - "<"
131
+ - !ruby/object:Gem::Version
132
+ version: '8'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '4'
140
+ - - "<"
141
+ - !ruby/object:Gem::Version
142
+ version: '8'
143
+ - !ruby/object:Gem::Dependency
144
+ name: mongoid-locker
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '2.0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '2.0'
109
157
  description: For use with client side single page apps such as the venerable https://github.com/lynndylanhurley/ng-token-auth.
110
158
  email:
111
159
  - lynn.dylan.hurley@gmail.com
@@ -126,21 +174,26 @@ files:
126
174
  - app/controllers/devise_token_auth/sessions_controller.rb
127
175
  - app/controllers/devise_token_auth/token_validations_controller.rb
128
176
  - app/controllers/devise_token_auth/unlocks_controller.rb
177
+ - app/models/devise_token_auth/concerns/active_record_support.rb
178
+ - app/models/devise_token_auth/concerns/confirmable_support.rb
179
+ - app/models/devise_token_auth/concerns/mongoid_support.rb
180
+ - app/models/devise_token_auth/concerns/tokens_serialization.rb
129
181
  - app/models/devise_token_auth/concerns/user.rb
130
182
  - app/models/devise_token_auth/concerns/user_omniauth_callbacks.rb
131
- - app/validators/email_validator.rb
183
+ - app/validators/devise_token_auth_email_validator.rb
132
184
  - app/views/devise/mailer/confirmation_instructions.html.erb
133
185
  - app/views/devise/mailer/reset_password_instructions.html.erb
134
186
  - app/views/devise/mailer/unlock_instructions.html.erb
135
187
  - app/views/devise_token_auth/omniauth_external_window.html.erb
136
- - config/initializers/devise.rb
137
188
  - config/locales/da-DK.yml
138
189
  - config/locales/de.yml
139
190
  - config/locales/en.yml
140
191
  - config/locales/es.yml
141
192
  - config/locales/fr.yml
193
+ - config/locales/he.yml
142
194
  - config/locales/it.yml
143
195
  - config/locales/ja.yml
196
+ - config/locales/ko.yml
144
197
  - config/locales/nl.yml
145
198
  - config/locales/pl.yml
146
199
  - config/locales/pt-BR.yml
@@ -155,19 +208,24 @@ files:
155
208
  - config/locales/zh-HK.yml
156
209
  - config/locales/zh-TW.yml
157
210
  - lib/devise_token_auth.rb
211
+ - lib/devise_token_auth/blacklist.rb
158
212
  - lib/devise_token_auth/controllers/helpers.rb
159
213
  - lib/devise_token_auth/controllers/url_helpers.rb
160
214
  - lib/devise_token_auth/engine.rb
161
215
  - lib/devise_token_auth/errors.rb
162
216
  - lib/devise_token_auth/rails/routes.rb
217
+ - lib/devise_token_auth/token_factory.rb
163
218
  - lib/devise_token_auth/url.rb
164
219
  - lib/devise_token_auth/version.rb
165
220
  - lib/generators/devise_token_auth/USAGE
166
221
  - lib/generators/devise_token_auth/install_generator.rb
222
+ - lib/generators/devise_token_auth/install_generator_helpers.rb
223
+ - lib/generators/devise_token_auth/install_mongoid_generator.rb
167
224
  - lib/generators/devise_token_auth/install_views_generator.rb
168
225
  - lib/generators/devise_token_auth/templates/devise_token_auth.rb
169
226
  - lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb
170
227
  - lib/generators/devise_token_auth/templates/user.rb.erb
228
+ - lib/generators/devise_token_auth/templates/user_mongoid.rb.erb
171
229
  - lib/tasks/devise_token_auth_tasks.rake
172
230
  - test/controllers/custom/custom_confirmations_controller_test.rb
173
231
  - test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
@@ -192,6 +250,14 @@ files:
192
250
  - test/controllers/overrides/sessions_controller_test.rb
193
251
  - test/controllers/overrides/token_validations_controller_test.rb
194
252
  - test/dummy/README.rdoc
253
+ - test/dummy/app/active_record/confirmable_user.rb
254
+ - test/dummy/app/active_record/lockable_user.rb
255
+ - test/dummy/app/active_record/mang.rb
256
+ - test/dummy/app/active_record/only_email_user.rb
257
+ - test/dummy/app/active_record/scoped_user.rb
258
+ - test/dummy/app/active_record/unconfirmable_user.rb
259
+ - test/dummy/app/active_record/unregisterable_user.rb
260
+ - test/dummy/app/active_record/user.rb
195
261
  - test/dummy/app/controllers/application_controller.rb
196
262
  - test/dummy/app/controllers/auth_origin_controller.rb
197
263
  - test/dummy/app/controllers/custom/confirmations_controller.rb
@@ -210,13 +276,15 @@ files:
210
276
  - test/dummy/app/controllers/overrides/sessions_controller.rb
211
277
  - test/dummy/app/controllers/overrides/token_validations_controller.rb
212
278
  - test/dummy/app/helpers/application_helper.rb
213
- - test/dummy/app/models/lockable_user.rb
214
- - test/dummy/app/models/mang.rb
215
- - test/dummy/app/models/only_email_user.rb
216
- - test/dummy/app/models/scoped_user.rb
217
- - test/dummy/app/models/unconfirmable_user.rb
218
- - test/dummy/app/models/unregisterable_user.rb
219
- - test/dummy/app/models/user.rb
279
+ - test/dummy/app/models/concerns/favorite_color.rb
280
+ - test/dummy/app/mongoid/confirmable_user.rb
281
+ - test/dummy/app/mongoid/lockable_user.rb
282
+ - test/dummy/app/mongoid/mang.rb
283
+ - test/dummy/app/mongoid/only_email_user.rb
284
+ - test/dummy/app/mongoid/scoped_user.rb
285
+ - test/dummy/app/mongoid/unconfirmable_user.rb
286
+ - test/dummy/app/mongoid/unregisterable_user.rb
287
+ - test/dummy/app/mongoid/user.rb
220
288
  - test/dummy/app/views/layouts/application.html.erb
221
289
  - test/dummy/config.ru
222
290
  - test/dummy/config/application.rb
@@ -226,7 +294,6 @@ files:
226
294
  - test/dummy/config/environments/development.rb
227
295
  - test/dummy/config/environments/production.rb
228
296
  - test/dummy/config/environments/test.rb
229
- - test/dummy/config/initializers/assets.rb
230
297
  - test/dummy/config/initializers/backtrace_silencers.rb
231
298
  - test/dummy/config/initializers/cookies_serializer.rb
232
299
  - test/dummy/config/initializers/devise.rb
@@ -249,24 +316,33 @@ files:
249
316
  - test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb
250
317
  - test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
251
318
  - test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
319
+ - test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb
252
320
  - test/dummy/db/schema.rb
253
321
  - test/dummy/lib/migration_database_helper.rb
254
- - test/dummy/tmp/generators/app/views/devise/mailer/confirmation_instructions.html.erb
255
- - test/dummy/tmp/generators/app/views/devise/mailer/reset_password_instructions.html.erb
322
+ - test/dummy/tmp/generators/app/models/user.rb
323
+ - test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
324
+ - test/dummy/tmp/generators/db/migrate/20230415183419_devise_token_auth_create_users.rb
256
325
  - test/factories/users.rb
326
+ - test/lib/devise_token_auth/blacklist_test.rb
327
+ - test/lib/devise_token_auth/rails/custom_routes_test.rb
328
+ - test/lib/devise_token_auth/rails/routes_test.rb
329
+ - test/lib/devise_token_auth/token_factory_test.rb
257
330
  - test/lib/devise_token_auth/url_test.rb
258
331
  - test/lib/generators/devise_token_auth/install_generator_test.rb
259
332
  - test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb
260
333
  - test/lib/generators/devise_token_auth/install_views_generator_test.rb
334
+ - test/models/concerns/mongoid_support_test.rb
335
+ - test/models/concerns/tokens_serialization_test.rb
336
+ - test/models/confirmable_user_test.rb
261
337
  - test/models/only_email_user_test.rb
262
338
  - test/models/user_test.rb
263
339
  - test/support/controllers/routes.rb
264
340
  - test/test_helper.rb
265
- homepage: http://github.com/lynndylanhurley/devise_token_auth
341
+ homepage: https://github.com/lynndylanhurley/devise_token_auth
266
342
  licenses:
267
343
  - WTFPL
268
344
  metadata: {}
269
- post_install_message:
345
+ post_install_message:
270
346
  rdoc_options: []
271
347
  require_paths:
272
348
  - lib
@@ -274,109 +350,126 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
350
  requirements:
275
351
  - - ">="
276
352
  - !ruby/object:Gem::Version
277
- version: 2.2.0
353
+ version: 2.3.0
278
354
  required_rubygems_version: !ruby/object:Gem::Requirement
279
355
  requirements:
280
356
  - - ">="
281
357
  - !ruby/object:Gem::Version
282
358
  version: '0'
283
359
  requirements: []
284
- rubyforge_project:
285
- rubygems_version: 2.6.14.1
286
- signing_key:
360
+ rubygems_version: 3.3.7
361
+ signing_key:
287
362
  specification_version: 4
288
363
  summary: Token based authentication for rails. Uses Devise + OmniAuth.
289
364
  test_files:
290
- - test/dummy/app/models/only_email_user.rb
291
- - test/dummy/app/models/scoped_user.rb
292
- - test/dummy/app/models/mang.rb
293
- - test/dummy/app/models/unregisterable_user.rb
294
- - test/dummy/app/models/lockable_user.rb
295
- - test/dummy/app/models/unconfirmable_user.rb
296
- - test/dummy/app/models/user.rb
297
- - test/dummy/app/controllers/overrides/token_validations_controller.rb
298
- - test/dummy/app/controllers/overrides/omniauth_callbacks_controller.rb
299
- - test/dummy/app/controllers/overrides/passwords_controller.rb
300
- - test/dummy/app/controllers/overrides/sessions_controller.rb
301
- - test/dummy/app/controllers/overrides/confirmations_controller.rb
302
- - test/dummy/app/controllers/overrides/registrations_controller.rb
365
+ - test/controllers/custom/custom_confirmations_controller_test.rb
366
+ - test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
367
+ - test/controllers/custom/custom_passwords_controller_test.rb
368
+ - test/controllers/custom/custom_registrations_controller_test.rb
369
+ - test/controllers/custom/custom_sessions_controller_test.rb
370
+ - test/controllers/custom/custom_token_validations_controller_test.rb
371
+ - test/controllers/demo_group_controller_test.rb
372
+ - test/controllers/demo_mang_controller_test.rb
373
+ - test/controllers/demo_user_controller_test.rb
374
+ - test/controllers/devise_token_auth/confirmations_controller_test.rb
375
+ - test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb
376
+ - test/controllers/devise_token_auth/passwords_controller_test.rb
377
+ - test/controllers/devise_token_auth/registrations_controller_test.rb
378
+ - test/controllers/devise_token_auth/sessions_controller_test.rb
379
+ - test/controllers/devise_token_auth/token_validations_controller_test.rb
380
+ - test/controllers/devise_token_auth/unlocks_controller_test.rb
381
+ - test/controllers/overrides/confirmations_controller_test.rb
382
+ - test/controllers/overrides/omniauth_callbacks_controller_test.rb
383
+ - test/controllers/overrides/passwords_controller_test.rb
384
+ - test/controllers/overrides/registrations_controller_test.rb
385
+ - test/controllers/overrides/sessions_controller_test.rb
386
+ - test/controllers/overrides/token_validations_controller_test.rb
387
+ - test/dummy/README.rdoc
388
+ - test/dummy/app/active_record/confirmable_user.rb
389
+ - test/dummy/app/active_record/lockable_user.rb
390
+ - test/dummy/app/active_record/mang.rb
391
+ - test/dummy/app/active_record/only_email_user.rb
392
+ - test/dummy/app/active_record/scoped_user.rb
393
+ - test/dummy/app/active_record/unconfirmable_user.rb
394
+ - test/dummy/app/active_record/unregisterable_user.rb
395
+ - test/dummy/app/active_record/user.rb
303
396
  - test/dummy/app/controllers/application_controller.rb
304
- - test/dummy/app/controllers/demo_user_controller.rb
305
397
  - test/dummy/app/controllers/auth_origin_controller.rb
306
- - test/dummy/app/controllers/demo_mang_controller.rb
307
- - test/dummy/app/controllers/demo_group_controller.rb
308
- - test/dummy/app/controllers/custom/token_validations_controller.rb
398
+ - test/dummy/app/controllers/custom/confirmations_controller.rb
309
399
  - test/dummy/app/controllers/custom/omniauth_callbacks_controller.rb
310
400
  - test/dummy/app/controllers/custom/passwords_controller.rb
311
- - test/dummy/app/controllers/custom/sessions_controller.rb
312
- - test/dummy/app/controllers/custom/confirmations_controller.rb
313
401
  - test/dummy/app/controllers/custom/registrations_controller.rb
314
- - test/dummy/app/views/layouts/application.html.erb
402
+ - test/dummy/app/controllers/custom/sessions_controller.rb
403
+ - test/dummy/app/controllers/custom/token_validations_controller.rb
404
+ - test/dummy/app/controllers/demo_group_controller.rb
405
+ - test/dummy/app/controllers/demo_mang_controller.rb
406
+ - test/dummy/app/controllers/demo_user_controller.rb
407
+ - test/dummy/app/controllers/overrides/confirmations_controller.rb
408
+ - test/dummy/app/controllers/overrides/omniauth_callbacks_controller.rb
409
+ - test/dummy/app/controllers/overrides/passwords_controller.rb
410
+ - test/dummy/app/controllers/overrides/registrations_controller.rb
411
+ - test/dummy/app/controllers/overrides/sessions_controller.rb
412
+ - test/dummy/app/controllers/overrides/token_validations_controller.rb
315
413
  - test/dummy/app/helpers/application_helper.rb
316
- - test/dummy/config/routes.rb
317
- - test/dummy/config/environments/production.rb
318
- - test/dummy/config/environments/development.rb
319
- - test/dummy/config/environments/test.rb
320
- - test/dummy/config/spring.rb
321
- - test/dummy/config/environment.rb
414
+ - test/dummy/app/models/concerns/favorite_color.rb
415
+ - test/dummy/app/mongoid/confirmable_user.rb
416
+ - test/dummy/app/mongoid/lockable_user.rb
417
+ - test/dummy/app/mongoid/mang.rb
418
+ - test/dummy/app/mongoid/only_email_user.rb
419
+ - test/dummy/app/mongoid/scoped_user.rb
420
+ - test/dummy/app/mongoid/unconfirmable_user.rb
421
+ - test/dummy/app/mongoid/unregisterable_user.rb
422
+ - test/dummy/app/mongoid/user.rb
423
+ - test/dummy/app/views/layouts/application.html.erb
322
424
  - test/dummy/config/application.rb
323
- - test/dummy/config/boot.rb
324
425
  - test/dummy/config/application.yml.bk
426
+ - test/dummy/config/boot.rb
427
+ - test/dummy/config/environment.rb
428
+ - test/dummy/config/environments/development.rb
429
+ - test/dummy/config/environments/production.rb
430
+ - test/dummy/config/environments/test.rb
325
431
  - test/dummy/config/initializers/backtrace_silencers.rb
432
+ - test/dummy/config/initializers/cookies_serializer.rb
433
+ - test/dummy/config/initializers/devise.rb
326
434
  - test/dummy/config/initializers/devise_token_auth.rb
327
- - test/dummy/config/initializers/mime_types.rb
435
+ - test/dummy/config/initializers/figaro.rb
328
436
  - test/dummy/config/initializers/filter_parameter_logging.rb
437
+ - test/dummy/config/initializers/inflections.rb
438
+ - test/dummy/config/initializers/mime_types.rb
439
+ - test/dummy/config/initializers/omniauth.rb
329
440
  - test/dummy/config/initializers/session_store.rb
330
441
  - test/dummy/config/initializers/wrap_parameters.rb
331
- - test/dummy/config/initializers/assets.rb
332
- - test/dummy/config/initializers/cookies_serializer.rb
333
- - test/dummy/config/initializers/devise.rb
334
- - test/dummy/config/initializers/omniauth.rb
335
- - test/dummy/config/initializers/inflections.rb
336
- - test/dummy/config/initializers/figaro.rb
442
+ - test/dummy/config/routes.rb
443
+ - test/dummy/config/spring.rb
337
444
  - test/dummy/config.ru
338
- - test/dummy/lib/migration_database_helper.rb
339
- - test/dummy/db/schema.rb
340
- - test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb
445
+ - test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
446
+ - test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
341
447
  - test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb
342
448
  - test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb
343
- - test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb
344
449
  - test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb
345
- - test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
450
+ - test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb
451
+ - test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb
346
452
  - test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
347
- - test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
348
- - test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
349
- - test/dummy/tmp/generators/app/views/devise/mailer/confirmation_instructions.html.erb
350
- - test/dummy/tmp/generators/app/views/devise/mailer/reset_password_instructions.html.erb
351
- - test/dummy/README.rdoc
352
- - test/models/only_email_user_test.rb
353
- - test/models/user_test.rb
354
- - test/support/controllers/routes.rb
453
+ - test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
454
+ - test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb
455
+ - test/dummy/db/schema.rb
456
+ - test/dummy/lib/migration_database_helper.rb
457
+ - test/dummy/tmp/generators/app/models/user.rb
458
+ - test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
459
+ - test/dummy/tmp/generators/db/migrate/20230415183419_devise_token_auth_create_users.rb
355
460
  - test/factories/users.rb
461
+ - test/lib/devise_token_auth/blacklist_test.rb
462
+ - test/lib/devise_token_auth/rails/custom_routes_test.rb
463
+ - test/lib/devise_token_auth/rails/routes_test.rb
464
+ - test/lib/devise_token_auth/token_factory_test.rb
356
465
  - test/lib/devise_token_auth/url_test.rb
357
466
  - test/lib/generators/devise_token_auth/install_generator_test.rb
358
- - test/lib/generators/devise_token_auth/install_views_generator_test.rb
359
467
  - test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb
468
+ - test/lib/generators/devise_token_auth/install_views_generator_test.rb
469
+ - test/models/concerns/mongoid_support_test.rb
470
+ - test/models/concerns/tokens_serialization_test.rb
471
+ - test/models/confirmable_user_test.rb
472
+ - test/models/only_email_user_test.rb
473
+ - test/models/user_test.rb
474
+ - test/support/controllers/routes.rb
360
475
  - test/test_helper.rb
361
- - test/controllers/overrides/token_validations_controller_test.rb
362
- - test/controllers/overrides/confirmations_controller_test.rb
363
- - test/controllers/overrides/registrations_controller_test.rb
364
- - test/controllers/overrides/omniauth_callbacks_controller_test.rb
365
- - test/controllers/overrides/sessions_controller_test.rb
366
- - test/controllers/overrides/passwords_controller_test.rb
367
- - test/controllers/demo_mang_controller_test.rb
368
- - test/controllers/devise_token_auth/token_validations_controller_test.rb
369
- - test/controllers/devise_token_auth/confirmations_controller_test.rb
370
- - test/controllers/devise_token_auth/unlocks_controller_test.rb
371
- - test/controllers/devise_token_auth/registrations_controller_test.rb
372
- - test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb
373
- - test/controllers/devise_token_auth/sessions_controller_test.rb
374
- - test/controllers/devise_token_auth/passwords_controller_test.rb
375
- - test/controllers/demo_user_controller_test.rb
376
- - test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
377
- - test/controllers/custom/custom_sessions_controller_test.rb
378
- - test/controllers/custom/custom_confirmations_controller_test.rb
379
- - test/controllers/custom/custom_token_validations_controller_test.rb
380
- - test/controllers/custom/custom_registrations_controller_test.rb
381
- - test/controllers/custom/custom_passwords_controller_test.rb
382
- - test/controllers/demo_group_controller_test.rb
@@ -1,198 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Use this hook to configure devise mailer, warden hooks and so forth.
4
- # Many of these configuration options can be set straight in your model.
5
- Devise.setup do |config|
6
- # The secret key used by Devise. Devise uses this key to generate
7
- # random tokens. Changing this key will render invalid all existing
8
- # confirmation, reset password and unlock tokens in the database.
9
- # config.secret_key = 'd029dbc7262359b4f9906ec029bae825981dee112d9a1425643719765c8fd4884f12a37add35607fa3fa2d6fa6945a0077d7fe0f10a67f8ee66d69e9cc6ac19b'
10
-
11
- # ==> Mailer Configuration
12
- # Configure the e-mail address which will be shown in Devise::Mailer,
13
- # note that it will be overwritten if you use your own mailer class
14
- # with default "from" parameter.
15
- config.mailer_sender = 'no-reply@example.com'
16
-
17
- # Configure the class responsible to send e-mails.
18
- # config.mailer = 'Devise::Mailer'
19
-
20
- # ==> ORM configuration
21
- # Load and configure the ORM. Supports :active_record (default) and
22
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
23
- # available as additional gems.
24
- require 'devise/orm/active_record'
25
-
26
- # ==> Configuration for any authentication mechanism
27
- # Configure which keys are used when authenticating a user. The default is
28
- # just :email. You can configure it to use [:username, :subdomain], so for
29
- # authenticating a user, both parameters are required. Remember that those
30
- # parameters are used only when authenticating and not when retrieving from
31
- # session. If you need permissions, you should implement that in a before filter.
32
- # You can also supply a hash where the value is a boolean determining whether
33
- # or not authentication should be aborted when the value is not present.
34
- # config.authentication_keys = [ :email ]
35
-
36
- # Configure parameters from the request object used for authentication. Each entry
37
- # given should be a request method and it will automatically be passed to the
38
- # find_for_authentication method and considered in your model lookup. For instance,
39
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
40
- # The same considerations mentioned for authentication_keys also apply to request_keys.
41
- # config.request_keys = []
42
-
43
- # Configure which authentication keys should be case-insensitive.
44
- # These keys will be downcased upon creating or modifying a user and when used
45
- # to authenticate or find a user. Default is :email.
46
- config.case_insensitive_keys = [ :email ]
47
-
48
- # Configure which authentication keys should have whitespace stripped.
49
- # These keys will have whitespace before and after removed upon creating or
50
- # modifying a user and when used to authenticate or find a user. Default is :email.
51
- config.strip_whitespace_keys = [ :email ]
52
-
53
- # Tell if authentication through request.params is enabled. True by default.
54
- # It can be set to an array that will enable params authentication only for the
55
- # given strategies, for example, `config.params_authenticatable = [:database]` will
56
- # enable it only for database (email + password) authentication.
57
- # config.params_authenticatable = true
58
-
59
- # Tell if authentication through HTTP Auth is enabled. False by default.
60
- # It can be set to an array that will enable http authentication only for the
61
- # given strategies, for example, `config.http_authenticatable = [:database]` will
62
- # enable it only for database authentication. The supported strategies are:
63
- # :database = Support basic authentication with authentication key + password
64
- # config.http_authenticatable = false
65
-
66
- # If http headers should be returned for AJAX requests. True by default.
67
- # config.http_authenticatable_on_xhr = true
68
-
69
- # The realm used in Http Basic Authentication. 'Application' by default.
70
- # config.http_authentication_realm = 'Application'
71
-
72
- # It will change confirmation, password recovery and other workflows
73
- # to behave the same regardless if the e-mail provided was right or wrong.
74
- # Does not affect registerable.
75
- # config.paranoid = true
76
-
77
- # By default Devise will store the user in session. You can skip storage for
78
- # particular strategies by setting this option.
79
- # Notice that if you are skipping storage for all authentication paths, you
80
- # may want to disable generating routes to Devise's sessions controller by
81
- # passing skip: :sessions to `devise_for` in your config/routes.rb
82
- config.skip_session_storage = [:http_auth]
83
-
84
- # By default, Devise cleans up the CSRF token on authentication to
85
- # avoid CSRF token fixation attacks. This means that, when using AJAX
86
- # requests for sign in and sign up, you need to get a new CSRF token
87
- # from the server. You can disable this option at your own risk.
88
- # config.clean_up_csrf_token_on_authentication = true
89
-
90
- # ==> Configuration for :database_authenticatable
91
- # For bcrypt, this is the cost for hashing the password and defaults to 11. If
92
- # using other algorithms, it sets how many times you want the password to be hashed.
93
- #
94
- # Limiting the stretches to just one in testing will increase the performance of
95
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
96
- # a value less than 10 in other environments. Note that, for bcrypt (the default
97
- # algorithm), the cost increases exponentially with the number of stretches (e.g.
98
- # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
99
- config.stretches = Rails.env.test? ? 1 : 11
100
-
101
- # Setup a pepper to generate the encrypted password.
102
- # config.pepper = '8ff086600aff82d68ff1e00d23c99c821e66652ec8c2a5b48f58de4a56b325cb532f6db660cf58fc5ecb473b9d851be8cd1badff0a1053bc9dc045f78b6e6772'
103
-
104
- # ==> Configuration for :confirmable
105
- # A period that the user is allowed to access the website even without
106
- # confirming their account. For instance, if set to 2.days, the user will be
107
- # able to access the website for two days without confirming their account,
108
- # access will be blocked just in the third day. Default is 0.days, meaning
109
- # the user cannot access the website without confirming their account.
110
- # config.allow_unconfirmed_access_for = 2.days
111
-
112
- # A period that the user is allowed to confirm their account before their
113
- # token becomes invalid. For example, if set to 3.days, the user can confirm
114
- # their account within 3 days after the mail was sent, but on the fourth day
115
- # their account can't be confirmed with the token any more.
116
- # Default is nil, meaning there is no restriction on how long a user can take
117
- # before confirming their account.
118
- # config.confirm_within = 3.days
119
-
120
- # If true, requires any email changes to be confirmed (exactly the same way as
121
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
122
- # db field (see migrations). Until confirmed, new email is stored in
123
- # unconfirmed_email column, and copied to email column on successful confirmation.
124
- config.reconfirmable = true
125
-
126
- # Defines which key will be used when confirming an account
127
- # config.confirmation_keys = [ :email ]
128
-
129
- # ==> Configuration for :rememberable
130
- # The time the user will be remembered without asking for credentials again.
131
- # config.remember_for = 2.weeks
132
-
133
- # If true, extends the user's remember period when remembered via cookie.
134
- # config.extend_remember_period = false
135
-
136
- # Options to be passed to the created cookie. For instance, you can set
137
- # secure: true in order to force SSL only cookies.
138
- # config.rememberable_options = {}
139
-
140
- # ==> Configuration for :validatable
141
- # Range for password length.
142
- config.password_length = 8..128
143
-
144
- # Email regex used to validate email formats. It simply asserts that
145
- # one (and only one) @ exists in the given string. This is mainly
146
- # to give user feedback and not to assert the e-mail validity.
147
- config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
148
-
149
- # ==> Configuration for :timeoutable
150
- # The time you want to timeout the user session without activity. After this
151
- # time the user will be asked for credentials again. Default is 30 minutes.
152
- # config.timeout_in = 30.minutes
153
-
154
- # If true, expires auth token on session timeout.
155
- # config.expire_auth_token_on_timeout = false
156
-
157
- # ==> Configuration for :lockable
158
- # Defines which strategy will be used to lock an account.
159
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
160
- # :none = No lock strategy. You should handle locking by yourself.
161
- # config.lock_strategy = :failed_attempts
162
-
163
- # Defines which key will be used when locking and unlocking an account
164
- # config.unlock_keys = [ :email ]
165
-
166
- # Defines which strategy will be used to unlock an account.
167
- # :email = Sends an unlock link to the user email
168
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
169
- # :both = Enables both strategies
170
- # :none = No unlock strategy. You should handle unlocking by yourself.
171
- # config.unlock_strategy = :both
172
-
173
- # Number of authentication tries before locking an account if lock_strategy
174
- # is failed attempts.
175
- # config.maximum_attempts = 20
176
-
177
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
178
- # config.unlock_in = 1.hour
179
-
180
- # Warn on the last attempt before the account is locked.
181
- # config.last_attempt_warning = false
182
-
183
- # ==> Configuration for :recoverable
184
- #
185
- # Defines which key will be used when recovering the password for an account
186
- # config.reset_password_keys = [ :email ]
187
-
188
- # Time interval you can reset your password with a reset password key.
189
- # Don't put a too small interval or your users won't have the time to
190
- # change their passwords.
191
- config.reset_password_within = 6.hours
192
-
193
- # The default HTTP method used to sign out a resource. Default is :delete.
194
- config.sign_out_via = :delete
195
-
196
- # don't serialize tokens
197
- Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION << :tokens
198
- end