devise_token_auth_multi_email 0.9.3 → 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/lib/devise_token_auth_multi_email.rb +3 -0
- 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 +59 -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
|
|
@@ -260,6 +255,7 @@ files:
|
|
|
260
255
|
- lib/devise_token_auth/token_factory.rb
|
|
261
256
|
- lib/devise_token_auth/url.rb
|
|
262
257
|
- lib/devise_token_auth/version.rb
|
|
258
|
+
- lib/devise_token_auth_multi_email.rb
|
|
263
259
|
- lib/generators/devise_token_auth/USAGE
|
|
264
260
|
- lib/generators/devise_token_auth/install_generator.rb
|
|
265
261
|
- lib/generators/devise_token_auth/install_generator_helpers.rb
|
|
@@ -280,10 +276,17 @@ files:
|
|
|
280
276
|
- test/controllers/demo_mang_controller_test.rb
|
|
281
277
|
- test/controllers/demo_user_controller_test.rb
|
|
282
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
|
|
283
285
|
- test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb
|
|
284
286
|
- test/controllers/devise_token_auth/passwords_controller_test.rb
|
|
285
287
|
- test/controllers/devise_token_auth/registrations_controller_test.rb
|
|
286
288
|
- test/controllers/devise_token_auth/sessions_controller_test.rb
|
|
289
|
+
- test/controllers/devise_token_auth/standard_user_registrations_controller_test.rb
|
|
287
290
|
- test/controllers/devise_token_auth/token_validations_controller_test.rb
|
|
288
291
|
- test/controllers/devise_token_auth/unlocks_controller_test.rb
|
|
289
292
|
- test/controllers/overrides/confirmations_controller_test.rb
|
|
@@ -292,10 +295,14 @@ files:
|
|
|
292
295
|
- test/controllers/overrides/registrations_controller_test.rb
|
|
293
296
|
- test/controllers/overrides/sessions_controller_test.rb
|
|
294
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
|
|
295
300
|
- test/dummy/README.rdoc
|
|
296
301
|
- test/dummy/app/active_record/confirmable_user.rb
|
|
297
302
|
- test/dummy/app/active_record/lockable_user.rb
|
|
298
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
|
|
299
306
|
- test/dummy/app/active_record/only_email_user.rb
|
|
300
307
|
- test/dummy/app/active_record/scoped_user.rb
|
|
301
308
|
- test/dummy/app/active_record/unconfirmable_user.rb
|
|
@@ -360,34 +367,41 @@ files:
|
|
|
360
367
|
- test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
|
|
361
368
|
- test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
|
|
362
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
|
|
363
372
|
- test/dummy/db/schema.rb
|
|
373
|
+
- test/dummy/db/test.sqlite3-shm
|
|
364
374
|
- test/dummy/lib/migration_database_helper.rb
|
|
365
|
-
- test/dummy/tmp/generators/app/
|
|
366
|
-
- 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
|
|
367
377
|
- test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
|
|
368
|
-
- test/dummy/tmp/generators/
|
|
369
|
-
- test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_mangs.rb
|
|
370
|
-
- 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
|
|
371
379
|
- test/factories/users.rb
|
|
372
380
|
- test/lib/devise_token_auth/blacklist_test.rb
|
|
381
|
+
- test/lib/devise_token_auth/controllers/helpers_test.rb
|
|
373
382
|
- test/lib/devise_token_auth/rails/custom_routes_test.rb
|
|
374
383
|
- test/lib/devise_token_auth/rails/routes_test.rb
|
|
375
384
|
- test/lib/devise_token_auth/token_factory_test.rb
|
|
376
385
|
- test/lib/devise_token_auth/url_test.rb
|
|
377
386
|
- test/lib/generators/devise_token_auth/install_generator_test.rb
|
|
378
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
|
|
379
389
|
- test/lib/generators/devise_token_auth/install_views_generator_test.rb
|
|
380
390
|
- test/models/concerns/mongoid_support_test.rb
|
|
381
391
|
- test/models/concerns/tokens_serialization_test.rb
|
|
382
392
|
- test/models/confirmable_user_test.rb
|
|
393
|
+
- test/models/multi_email_user_email_test.rb
|
|
394
|
+
- test/models/multi_email_user_test.rb
|
|
383
395
|
- test/models/only_email_user_test.rb
|
|
384
396
|
- test/models/user_test.rb
|
|
385
397
|
- test/support/controllers/routes.rb
|
|
386
398
|
- test/test_helper.rb
|
|
399
|
+
- test/validators/devise_token_auth_email_validator_test.rb
|
|
387
400
|
homepage: https://github.com/mgmodell/devise_token_auth_multi_email
|
|
388
401
|
licenses:
|
|
389
402
|
- WTFPL
|
|
390
403
|
metadata: {}
|
|
404
|
+
post_install_message:
|
|
391
405
|
rdoc_options: []
|
|
392
406
|
require_paths:
|
|
393
407
|
- lib
|
|
@@ -402,7 +416,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
402
416
|
- !ruby/object:Gem::Version
|
|
403
417
|
version: '0'
|
|
404
418
|
requirements: []
|
|
405
|
-
rubygems_version: 3.
|
|
419
|
+
rubygems_version: 3.5.22
|
|
420
|
+
signing_key:
|
|
406
421
|
specification_version: 4
|
|
407
422
|
summary: Token based authentication for rails. Uses Devise + OmniAuth + multiple emails.
|
|
408
423
|
test_files:
|
|
@@ -416,10 +431,17 @@ test_files:
|
|
|
416
431
|
- test/controllers/demo_mang_controller_test.rb
|
|
417
432
|
- test/controllers/demo_user_controller_test.rb
|
|
418
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
|
|
419
440
|
- test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb
|
|
420
441
|
- test/controllers/devise_token_auth/passwords_controller_test.rb
|
|
421
442
|
- test/controllers/devise_token_auth/registrations_controller_test.rb
|
|
422
443
|
- test/controllers/devise_token_auth/sessions_controller_test.rb
|
|
444
|
+
- test/controllers/devise_token_auth/standard_user_registrations_controller_test.rb
|
|
423
445
|
- test/controllers/devise_token_auth/token_validations_controller_test.rb
|
|
424
446
|
- test/controllers/devise_token_auth/unlocks_controller_test.rb
|
|
425
447
|
- test/controllers/overrides/confirmations_controller_test.rb
|
|
@@ -428,10 +450,14 @@ test_files:
|
|
|
428
450
|
- test/controllers/overrides/registrations_controller_test.rb
|
|
429
451
|
- test/controllers/overrides/sessions_controller_test.rb
|
|
430
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
|
|
431
455
|
- test/dummy/README.rdoc
|
|
432
456
|
- test/dummy/app/active_record/confirmable_user.rb
|
|
433
457
|
- test/dummy/app/active_record/lockable_user.rb
|
|
434
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
|
|
435
461
|
- test/dummy/app/active_record/only_email_user.rb
|
|
436
462
|
- test/dummy/app/active_record/scoped_user.rb
|
|
437
463
|
- test/dummy/app/active_record/unconfirmable_user.rb
|
|
@@ -465,7 +491,6 @@ test_files:
|
|
|
465
491
|
- test/dummy/app/mongoid/unregisterable_user.rb
|
|
466
492
|
- test/dummy/app/mongoid/user.rb
|
|
467
493
|
- test/dummy/app/views/layouts/application.html.erb
|
|
468
|
-
- test/dummy/config.ru
|
|
469
494
|
- test/dummy/config/application.rb
|
|
470
495
|
- test/dummy/config/application.yml.bk
|
|
471
496
|
- test/dummy/config/boot.rb
|
|
@@ -486,6 +511,7 @@ test_files:
|
|
|
486
511
|
- test/dummy/config/initializers/wrap_parameters.rb
|
|
487
512
|
- test/dummy/config/routes.rb
|
|
488
513
|
- test/dummy/config/spring.rb
|
|
514
|
+
- test/dummy/config.ru
|
|
489
515
|
- test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
|
|
490
516
|
- test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
|
|
491
517
|
- test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb
|
|
@@ -496,27 +522,33 @@ test_files:
|
|
|
496
522
|
- test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb
|
|
497
523
|
- test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb
|
|
498
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
|
|
499
527
|
- test/dummy/db/schema.rb
|
|
528
|
+
- test/dummy/db/test.sqlite3-shm
|
|
500
529
|
- test/dummy/lib/migration_database_helper.rb
|
|
501
|
-
- test/dummy/tmp/generators/app/
|
|
502
|
-
- 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
|
|
503
532
|
- test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
|
|
504
|
-
- test/dummy/tmp/generators/
|
|
505
|
-
- test/dummy/tmp/generators/db/migrate/20210305040222_devise_token_auth_create_mangs.rb
|
|
506
|
-
- 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
|
|
507
534
|
- test/factories/users.rb
|
|
508
535
|
- test/lib/devise_token_auth/blacklist_test.rb
|
|
536
|
+
- test/lib/devise_token_auth/controllers/helpers_test.rb
|
|
509
537
|
- test/lib/devise_token_auth/rails/custom_routes_test.rb
|
|
510
538
|
- test/lib/devise_token_auth/rails/routes_test.rb
|
|
511
539
|
- test/lib/devise_token_auth/token_factory_test.rb
|
|
512
540
|
- test/lib/devise_token_auth/url_test.rb
|
|
513
541
|
- test/lib/generators/devise_token_auth/install_generator_test.rb
|
|
514
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
|
|
515
544
|
- test/lib/generators/devise_token_auth/install_views_generator_test.rb
|
|
516
545
|
- test/models/concerns/mongoid_support_test.rb
|
|
517
546
|
- test/models/concerns/tokens_serialization_test.rb
|
|
518
547
|
- test/models/confirmable_user_test.rb
|
|
548
|
+
- test/models/multi_email_user_email_test.rb
|
|
549
|
+
- test/models/multi_email_user_test.rb
|
|
519
550
|
- test/models/only_email_user_test.rb
|
|
520
551
|
- test/models/user_test.rb
|
|
521
552
|
- test/support/controllers/routes.rb
|
|
522
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
|