devise_token_auth_multi_email 0.9.4 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/Rakefile +4 -8
- data/app/controllers/devise_token_auth/concerns/resource_finder.rb +2 -9
- data/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +35 -5
- data/app/controllers/devise_token_auth/registrations_controller.rb +24 -18
- data/app/models/devise_token_auth/concerns/user_omniauth_callbacks.rb +6 -3
- data/lib/devise_token_auth/engine.rb +40 -1
- data/lib/devise_token_auth/version.rb +1 -1
- data/test/controllers/devise_token_auth/confirmations_controller_test.rb +4 -4
- data/test/controllers/devise_token_auth/multi_email_coexistence_test.rb +130 -0
- data/test/controllers/devise_token_auth/multi_email_confirmations_controller_test.rb +210 -0
- data/test/controllers/devise_token_auth/multi_email_passwords_controller_test.rb +247 -0
- data/test/controllers/devise_token_auth/multi_email_registrations_controller_test.rb +137 -0
- data/test/controllers/devise_token_auth/multi_email_sessions_controller_test.rb +191 -0
- data/test/controllers/devise_token_auth/multi_email_token_validations_controller_test.rb +140 -0
- data/test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb +5 -4
- data/test/controllers/devise_token_auth/standard_user_registrations_controller_test.rb +165 -0
- data/test/coverage/assets/0.13.2/colorbox/loading.gif +0 -0
- data/test/coverage/assets/0.13.2/loading.gif +0 -0
- data/test/dummy/app/active_record/multi_email_user.rb +45 -0
- data/test/dummy/app/active_record/multi_email_user_email.rb +21 -0
- data/test/dummy/config/application.rb +6 -1
- data/test/dummy/config/initializers/omniauth.rb +15 -1
- data/test/dummy/config/routes.rb +8 -0
- data/test/dummy/db/migrate/20260401000001_devise_token_auth_create_multi_email_users.rb +49 -0
- data/test/dummy/db/migrate/20260401000002_devise_token_auth_create_multi_email_user_emails.rb +29 -0
- data/test/dummy/db/schema.rb +81 -41
- data/test/dummy/db/test.sqlite3-shm +0 -0
- data/test/dummy/tmp/generators/app/controllers/application_controller.rb +6 -0
- data/test/dummy/tmp/generators/app/models/{user.rb → azpire/v1/human_resource/user.rb} +1 -1
- data/test/dummy/tmp/generators/config/initializers/devise_token_auth.rb +11 -5
- data/test/dummy/tmp/generators/db/migrate/{20210305040222_devise_token_auth_create_users.rb → 20260408021432_devise_token_auth_create_azpire_v1_human_resource_users.rb} +7 -7
- data/test/factories/users.rb +1 -0
- data/test/lib/devise_token_auth/controllers/helpers_test.rb +402 -0
- data/test/lib/devise_token_auth/token_factory_test.rb +18 -18
- data/test/lib/generators/devise_token_auth/install_generator_test.rb +60 -0
- data/test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb +1 -1
- data/test/lib/generators/devise_token_auth/install_mongoid_generator_test.rb +218 -0
- data/test/models/multi_email_user_email_test.rb +95 -0
- data/test/models/multi_email_user_test.rb +225 -0
- data/test/test_helper.rb +21 -11
- data/test/validators/devise_token_auth_email_validator_test.rb +114 -0
- metadata +58 -27
- data/test/dummy/tmp/generators/app/models/mang.rb +0 -9
- data/test/dummy/tmp/generators/config/routes.rb +0 -9
- data/test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_mangs.rb +0 -49
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class DeviseTokenAuthEmailValidatorTest < ActiveSupport::TestCase
|
|
6
|
+
# A minimal ActiveModel object so we can test validate_each without a DB.
|
|
7
|
+
class EmailHolder
|
|
8
|
+
include ActiveModel::Validations
|
|
9
|
+
|
|
10
|
+
attr_accessor :email
|
|
11
|
+
|
|
12
|
+
validates :email, devise_token_auth_email: true
|
|
13
|
+
|
|
14
|
+
def initialize(email)
|
|
15
|
+
@email = email
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class EmailHolderWithCustomMessage
|
|
20
|
+
include ActiveModel::Validations
|
|
21
|
+
|
|
22
|
+
attr_accessor :email
|
|
23
|
+
|
|
24
|
+
validates :email, devise_token_auth_email: { message: 'is not a real email' }
|
|
25
|
+
|
|
26
|
+
def initialize(email)
|
|
27
|
+
@email = email
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# ---------------------------------------------------------------------------
|
|
32
|
+
# .validate? (class method)
|
|
33
|
+
# ---------------------------------------------------------------------------
|
|
34
|
+
describe '.validate?' do
|
|
35
|
+
describe 'valid email addresses' do
|
|
36
|
+
[
|
|
37
|
+
'user@example.com',
|
|
38
|
+
'User@Example.COM',
|
|
39
|
+
'user+tag@sub.example.org',
|
|
40
|
+
'u@x.io',
|
|
41
|
+
'first.last@domain.co.uk',
|
|
42
|
+
'user-name@my-domain.travel'
|
|
43
|
+
].each do |email|
|
|
44
|
+
test "accepts #{email}" do
|
|
45
|
+
assert DeviseTokenAuthEmailValidator.validate?(email),
|
|
46
|
+
"Expected '#{email}' to be valid"
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe 'invalid email addresses' do
|
|
52
|
+
[
|
|
53
|
+
nil,
|
|
54
|
+
'',
|
|
55
|
+
'plainaddress',
|
|
56
|
+
'@missing-local.org',
|
|
57
|
+
'user@',
|
|
58
|
+
'user@.com',
|
|
59
|
+
'user space@example.com',
|
|
60
|
+
'user@exam_ple.com'
|
|
61
|
+
].each do |email|
|
|
62
|
+
test "rejects #{email.inspect}" do
|
|
63
|
+
refute DeviseTokenAuthEmailValidator.validate?(email),
|
|
64
|
+
"Expected #{email.inspect} to be invalid"
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# ---------------------------------------------------------------------------
|
|
71
|
+
# validate_each (instance behaviour via ActiveModel::Validations)
|
|
72
|
+
# ---------------------------------------------------------------------------
|
|
73
|
+
describe 'validate_each' do
|
|
74
|
+
describe 'with a valid email' do
|
|
75
|
+
test 'does not add an error' do
|
|
76
|
+
holder = EmailHolder.new('user@example.com')
|
|
77
|
+
assert holder.valid?, "Expected holder to be valid but got: #{holder.errors.full_messages}"
|
|
78
|
+
assert_empty holder.errors[:email]
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
describe 'with an invalid email' do
|
|
83
|
+
test 'adds an error to the attribute' do
|
|
84
|
+
holder = EmailHolder.new('not-an-email')
|
|
85
|
+
refute holder.valid?
|
|
86
|
+
assert_not_empty holder.errors[:email]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
test 'error message uses I18n not_email key with invalid fallback' do
|
|
90
|
+
holder = EmailHolder.new('bad')
|
|
91
|
+
holder.valid?
|
|
92
|
+
expected = I18n.t(:'errors.messages.not_email', default: :'errors.messages.invalid')
|
|
93
|
+
assert_includes holder.errors[:email], expected
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# ---------------------------------------------------------------------------
|
|
99
|
+
# Custom :message option
|
|
100
|
+
# ---------------------------------------------------------------------------
|
|
101
|
+
describe 'custom message option' do
|
|
102
|
+
test 'uses the supplied message instead of the I18n default' do
|
|
103
|
+
holder = EmailHolderWithCustomMessage.new('not-an-email')
|
|
104
|
+
refute holder.valid?
|
|
105
|
+
assert_includes holder.errors[:email], 'is not a real email'
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
test 'does not add any error when the email is valid' do
|
|
109
|
+
holder = EmailHolderWithCustomMessage.new('user@example.com')
|
|
110
|
+
assert holder.valid?
|
|
111
|
+
assert_empty holder.errors[:email]
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: devise_token_auth_multi_email
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lynn Hurley
|
|
8
8
|
- Micah Gideon Modell
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
+
date: 2026-04-08 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: rails
|
|
@@ -65,19 +66,19 @@ dependencies:
|
|
|
65
66
|
- !ruby/object:Gem::Version
|
|
66
67
|
version: '3.0'
|
|
67
68
|
- !ruby/object:Gem::Dependency
|
|
68
|
-
name: devise-
|
|
69
|
+
name: devise-multi_email
|
|
69
70
|
requirement: !ruby/object:Gem::Requirement
|
|
70
71
|
requirements:
|
|
71
|
-
- - "
|
|
72
|
+
- - ">="
|
|
72
73
|
- !ruby/object:Gem::Version
|
|
73
|
-
version: '
|
|
74
|
+
version: '0'
|
|
74
75
|
type: :runtime
|
|
75
76
|
prerelease: false
|
|
76
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
77
78
|
requirements:
|
|
78
|
-
- - "
|
|
79
|
+
- - ">="
|
|
79
80
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '
|
|
81
|
+
version: '0'
|
|
81
82
|
- !ruby/object:Gem::Dependency
|
|
82
83
|
name: appraisal
|
|
83
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -112,20 +113,14 @@ dependencies:
|
|
|
112
113
|
requirements:
|
|
113
114
|
- - ">="
|
|
114
115
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '
|
|
116
|
-
- - "<"
|
|
117
|
-
- !ruby/object:Gem::Version
|
|
118
|
-
version: '3'
|
|
116
|
+
version: '0'
|
|
119
117
|
type: :development
|
|
120
118
|
prerelease: false
|
|
121
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
122
120
|
requirements:
|
|
123
121
|
- - ">="
|
|
124
122
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: '
|
|
126
|
-
- - "<"
|
|
127
|
-
- !ruby/object:Gem::Version
|
|
128
|
-
version: '3'
|
|
123
|
+
version: '0'
|
|
129
124
|
- !ruby/object:Gem::Dependency
|
|
130
125
|
name: pg
|
|
131
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -281,10 +276,17 @@ files:
|
|
|
281
276
|
- test/controllers/demo_mang_controller_test.rb
|
|
282
277
|
- test/controllers/demo_user_controller_test.rb
|
|
283
278
|
- test/controllers/devise_token_auth/confirmations_controller_test.rb
|
|
279
|
+
- test/controllers/devise_token_auth/multi_email_coexistence_test.rb
|
|
280
|
+
- test/controllers/devise_token_auth/multi_email_confirmations_controller_test.rb
|
|
281
|
+
- test/controllers/devise_token_auth/multi_email_passwords_controller_test.rb
|
|
282
|
+
- test/controllers/devise_token_auth/multi_email_registrations_controller_test.rb
|
|
283
|
+
- test/controllers/devise_token_auth/multi_email_sessions_controller_test.rb
|
|
284
|
+
- test/controllers/devise_token_auth/multi_email_token_validations_controller_test.rb
|
|
284
285
|
- test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb
|
|
285
286
|
- test/controllers/devise_token_auth/passwords_controller_test.rb
|
|
286
287
|
- test/controllers/devise_token_auth/registrations_controller_test.rb
|
|
287
288
|
- test/controllers/devise_token_auth/sessions_controller_test.rb
|
|
289
|
+
- test/controllers/devise_token_auth/standard_user_registrations_controller_test.rb
|
|
288
290
|
- test/controllers/devise_token_auth/token_validations_controller_test.rb
|
|
289
291
|
- test/controllers/devise_token_auth/unlocks_controller_test.rb
|
|
290
292
|
- test/controllers/overrides/confirmations_controller_test.rb
|
|
@@ -293,10 +295,14 @@ files:
|
|
|
293
295
|
- test/controllers/overrides/registrations_controller_test.rb
|
|
294
296
|
- test/controllers/overrides/sessions_controller_test.rb
|
|
295
297
|
- test/controllers/overrides/token_validations_controller_test.rb
|
|
298
|
+
- test/coverage/assets/0.13.2/colorbox/loading.gif
|
|
299
|
+
- test/coverage/assets/0.13.2/loading.gif
|
|
296
300
|
- test/dummy/README.rdoc
|
|
297
301
|
- test/dummy/app/active_record/confirmable_user.rb
|
|
298
302
|
- test/dummy/app/active_record/lockable_user.rb
|
|
299
303
|
- test/dummy/app/active_record/mang.rb
|
|
304
|
+
- test/dummy/app/active_record/multi_email_user.rb
|
|
305
|
+
- test/dummy/app/active_record/multi_email_user_email.rb
|
|
300
306
|
- test/dummy/app/active_record/only_email_user.rb
|
|
301
307
|
- test/dummy/app/active_record/scoped_user.rb
|
|
302
308
|
- test/dummy/app/active_record/unconfirmable_user.rb
|
|
@@ -361,34 +367,41 @@ files:
|
|
|
361
367
|
- test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
|
|
362
368
|
- test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
|
|
363
369
|
- test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb
|
|
370
|
+
- test/dummy/db/migrate/20260401000001_devise_token_auth_create_multi_email_users.rb
|
|
371
|
+
- test/dummy/db/migrate/20260401000002_devise_token_auth_create_multi_email_user_emails.rb
|
|
364
372
|
- test/dummy/db/schema.rb
|
|
373
|
+
- test/dummy/db/test.sqlite3-shm
|
|
365
374
|
- test/dummy/lib/migration_database_helper.rb
|
|
366
|
-
- test/dummy/tmp/generators/app/
|
|
367
|
-
- test/dummy/tmp/generators/app/models/user.rb
|
|
375
|
+
- test/dummy/tmp/generators/app/controllers/application_controller.rb
|
|
376
|
+
- test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb
|
|
368
377
|
- test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
|
|
369
|
-
- test/dummy/tmp/generators/
|
|
370
|
-
- test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_mangs.rb
|
|
371
|
-
- test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_users.rb
|
|
378
|
+
- test/dummy/tmp/generators/db/migrate/20260408021432_devise_token_auth_create_azpire_v1_human_resource_users.rb
|
|
372
379
|
- test/factories/users.rb
|
|
373
380
|
- test/lib/devise_token_auth/blacklist_test.rb
|
|
381
|
+
- test/lib/devise_token_auth/controllers/helpers_test.rb
|
|
374
382
|
- test/lib/devise_token_auth/rails/custom_routes_test.rb
|
|
375
383
|
- test/lib/devise_token_auth/rails/routes_test.rb
|
|
376
384
|
- test/lib/devise_token_auth/token_factory_test.rb
|
|
377
385
|
- test/lib/devise_token_auth/url_test.rb
|
|
378
386
|
- test/lib/generators/devise_token_auth/install_generator_test.rb
|
|
379
387
|
- test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb
|
|
388
|
+
- test/lib/generators/devise_token_auth/install_mongoid_generator_test.rb
|
|
380
389
|
- test/lib/generators/devise_token_auth/install_views_generator_test.rb
|
|
381
390
|
- test/models/concerns/mongoid_support_test.rb
|
|
382
391
|
- test/models/concerns/tokens_serialization_test.rb
|
|
383
392
|
- test/models/confirmable_user_test.rb
|
|
393
|
+
- test/models/multi_email_user_email_test.rb
|
|
394
|
+
- test/models/multi_email_user_test.rb
|
|
384
395
|
- test/models/only_email_user_test.rb
|
|
385
396
|
- test/models/user_test.rb
|
|
386
397
|
- test/support/controllers/routes.rb
|
|
387
398
|
- test/test_helper.rb
|
|
399
|
+
- test/validators/devise_token_auth_email_validator_test.rb
|
|
388
400
|
homepage: https://github.com/mgmodell/devise_token_auth_multi_email
|
|
389
401
|
licenses:
|
|
390
402
|
- WTFPL
|
|
391
403
|
metadata: {}
|
|
404
|
+
post_install_message:
|
|
392
405
|
rdoc_options: []
|
|
393
406
|
require_paths:
|
|
394
407
|
- lib
|
|
@@ -403,7 +416,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
403
416
|
- !ruby/object:Gem::Version
|
|
404
417
|
version: '0'
|
|
405
418
|
requirements: []
|
|
406
|
-
rubygems_version: 3.
|
|
419
|
+
rubygems_version: 3.5.22
|
|
420
|
+
signing_key:
|
|
407
421
|
specification_version: 4
|
|
408
422
|
summary: Token based authentication for rails. Uses Devise + OmniAuth + multiple emails.
|
|
409
423
|
test_files:
|
|
@@ -417,10 +431,17 @@ test_files:
|
|
|
417
431
|
- test/controllers/demo_mang_controller_test.rb
|
|
418
432
|
- test/controllers/demo_user_controller_test.rb
|
|
419
433
|
- test/controllers/devise_token_auth/confirmations_controller_test.rb
|
|
434
|
+
- test/controllers/devise_token_auth/multi_email_coexistence_test.rb
|
|
435
|
+
- test/controllers/devise_token_auth/multi_email_confirmations_controller_test.rb
|
|
436
|
+
- test/controllers/devise_token_auth/multi_email_passwords_controller_test.rb
|
|
437
|
+
- test/controllers/devise_token_auth/multi_email_registrations_controller_test.rb
|
|
438
|
+
- test/controllers/devise_token_auth/multi_email_sessions_controller_test.rb
|
|
439
|
+
- test/controllers/devise_token_auth/multi_email_token_validations_controller_test.rb
|
|
420
440
|
- test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb
|
|
421
441
|
- test/controllers/devise_token_auth/passwords_controller_test.rb
|
|
422
442
|
- test/controllers/devise_token_auth/registrations_controller_test.rb
|
|
423
443
|
- test/controllers/devise_token_auth/sessions_controller_test.rb
|
|
444
|
+
- test/controllers/devise_token_auth/standard_user_registrations_controller_test.rb
|
|
424
445
|
- test/controllers/devise_token_auth/token_validations_controller_test.rb
|
|
425
446
|
- test/controllers/devise_token_auth/unlocks_controller_test.rb
|
|
426
447
|
- test/controllers/overrides/confirmations_controller_test.rb
|
|
@@ -429,10 +450,14 @@ test_files:
|
|
|
429
450
|
- test/controllers/overrides/registrations_controller_test.rb
|
|
430
451
|
- test/controllers/overrides/sessions_controller_test.rb
|
|
431
452
|
- test/controllers/overrides/token_validations_controller_test.rb
|
|
453
|
+
- test/coverage/assets/0.13.2/colorbox/loading.gif
|
|
454
|
+
- test/coverage/assets/0.13.2/loading.gif
|
|
432
455
|
- test/dummy/README.rdoc
|
|
433
456
|
- test/dummy/app/active_record/confirmable_user.rb
|
|
434
457
|
- test/dummy/app/active_record/lockable_user.rb
|
|
435
458
|
- test/dummy/app/active_record/mang.rb
|
|
459
|
+
- test/dummy/app/active_record/multi_email_user.rb
|
|
460
|
+
- test/dummy/app/active_record/multi_email_user_email.rb
|
|
436
461
|
- test/dummy/app/active_record/only_email_user.rb
|
|
437
462
|
- test/dummy/app/active_record/scoped_user.rb
|
|
438
463
|
- test/dummy/app/active_record/unconfirmable_user.rb
|
|
@@ -466,7 +491,6 @@ test_files:
|
|
|
466
491
|
- test/dummy/app/mongoid/unregisterable_user.rb
|
|
467
492
|
- test/dummy/app/mongoid/user.rb
|
|
468
493
|
- test/dummy/app/views/layouts/application.html.erb
|
|
469
|
-
- test/dummy/config.ru
|
|
470
494
|
- test/dummy/config/application.rb
|
|
471
495
|
- test/dummy/config/application.yml.bk
|
|
472
496
|
- test/dummy/config/boot.rb
|
|
@@ -487,6 +511,7 @@ test_files:
|
|
|
487
511
|
- test/dummy/config/initializers/wrap_parameters.rb
|
|
488
512
|
- test/dummy/config/routes.rb
|
|
489
513
|
- test/dummy/config/spring.rb
|
|
514
|
+
- test/dummy/config.ru
|
|
490
515
|
- test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
|
|
491
516
|
- test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
|
|
492
517
|
- test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb
|
|
@@ -497,27 +522,33 @@ test_files:
|
|
|
497
522
|
- test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
|
|
498
523
|
- test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
|
|
499
524
|
- test/dummy/db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb
|
|
525
|
+
- test/dummy/db/migrate/20260401000001_devise_token_auth_create_multi_email_users.rb
|
|
526
|
+
- test/dummy/db/migrate/20260401000002_devise_token_auth_create_multi_email_user_emails.rb
|
|
500
527
|
- test/dummy/db/schema.rb
|
|
528
|
+
- test/dummy/db/test.sqlite3-shm
|
|
501
529
|
- test/dummy/lib/migration_database_helper.rb
|
|
502
|
-
- test/dummy/tmp/generators/app/
|
|
503
|
-
- test/dummy/tmp/generators/app/models/user.rb
|
|
530
|
+
- test/dummy/tmp/generators/app/controllers/application_controller.rb
|
|
531
|
+
- test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb
|
|
504
532
|
- test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
|
|
505
|
-
- test/dummy/tmp/generators/
|
|
506
|
-
- test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_mangs.rb
|
|
507
|
-
- test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_users.rb
|
|
533
|
+
- test/dummy/tmp/generators/db/migrate/20260408021432_devise_token_auth_create_azpire_v1_human_resource_users.rb
|
|
508
534
|
- test/factories/users.rb
|
|
509
535
|
- test/lib/devise_token_auth/blacklist_test.rb
|
|
536
|
+
- test/lib/devise_token_auth/controllers/helpers_test.rb
|
|
510
537
|
- test/lib/devise_token_auth/rails/custom_routes_test.rb
|
|
511
538
|
- test/lib/devise_token_auth/rails/routes_test.rb
|
|
512
539
|
- test/lib/devise_token_auth/token_factory_test.rb
|
|
513
540
|
- test/lib/devise_token_auth/url_test.rb
|
|
514
541
|
- test/lib/generators/devise_token_auth/install_generator_test.rb
|
|
515
542
|
- test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb
|
|
543
|
+
- test/lib/generators/devise_token_auth/install_mongoid_generator_test.rb
|
|
516
544
|
- test/lib/generators/devise_token_auth/install_views_generator_test.rb
|
|
517
545
|
- test/models/concerns/mongoid_support_test.rb
|
|
518
546
|
- test/models/concerns/tokens_serialization_test.rb
|
|
519
547
|
- test/models/confirmable_user_test.rb
|
|
548
|
+
- test/models/multi_email_user_email_test.rb
|
|
549
|
+
- test/models/multi_email_user_test.rb
|
|
520
550
|
- test/models/only_email_user_test.rb
|
|
521
551
|
- test/models/user_test.rb
|
|
522
552
|
- test/support/controllers/routes.rb
|
|
523
553
|
- test/test_helper.rb
|
|
554
|
+
- test/validators/devise_token_auth_email_validator_test.rb
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class Mang < ActiveRecord::Base
|
|
4
|
-
# Include default devise modules. Others available are:
|
|
5
|
-
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
|
6
|
-
devise :database_authenticatable, :registerable,
|
|
7
|
-
:recoverable, :rememberable, :validatable
|
|
8
|
-
include DeviseTokenAuth::Concerns::User
|
|
9
|
-
end
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
class DeviseTokenAuthCreateMangs < ActiveRecord::Migration[6.1]
|
|
2
|
-
def change
|
|
3
|
-
|
|
4
|
-
create_table(:mangs) do |t|
|
|
5
|
-
## Required
|
|
6
|
-
t.string :provider, :null => false, :default => "email"
|
|
7
|
-
t.string :uid, :null => false, :default => ""
|
|
8
|
-
|
|
9
|
-
## Database authenticatable
|
|
10
|
-
t.string :encrypted_password, :null => false, :default => ""
|
|
11
|
-
|
|
12
|
-
## Recoverable
|
|
13
|
-
t.string :reset_password_token
|
|
14
|
-
t.datetime :reset_password_sent_at
|
|
15
|
-
t.boolean :allow_password_change, :default => false
|
|
16
|
-
|
|
17
|
-
## Rememberable
|
|
18
|
-
t.datetime :remember_created_at
|
|
19
|
-
|
|
20
|
-
## Confirmable
|
|
21
|
-
t.string :confirmation_token
|
|
22
|
-
t.datetime :confirmed_at
|
|
23
|
-
t.datetime :confirmation_sent_at
|
|
24
|
-
t.string :unconfirmed_email # Only if using reconfirmable
|
|
25
|
-
|
|
26
|
-
## Lockable
|
|
27
|
-
# t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
|
|
28
|
-
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
|
29
|
-
# t.datetime :locked_at
|
|
30
|
-
|
|
31
|
-
## User Info
|
|
32
|
-
t.string :name
|
|
33
|
-
t.string :nickname
|
|
34
|
-
t.string :image
|
|
35
|
-
t.string :email
|
|
36
|
-
|
|
37
|
-
## Tokens
|
|
38
|
-
t.text :tokens
|
|
39
|
-
|
|
40
|
-
t.timestamps
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
add_index :mangs, :email, unique: true
|
|
44
|
-
add_index :mangs, [:uid, :provider], unique: true
|
|
45
|
-
add_index :mangs, :reset_password_token, unique: true
|
|
46
|
-
add_index :mangs, :confirmation_token, unique: true
|
|
47
|
-
# add_index :mangs, :unlock_token, unique: true
|
|
48
|
-
end
|
|
49
|
-
end
|