rails_base 0.55.0 → 0.56.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8848ee352824c072f2cb33947b77f92e4516a2bb606fc327c0af9a13c0239eeb
|
4
|
+
data.tar.gz: d6a05900f769175ddda5500073ae3158eecd9442c71955f29fd770ee8f2ce65e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc283c62b445089c071258a6363a6bc77fd184ba19d34dd06d6ba26a7962b2a6b2ad31e47140af7ba1d682ce6275e9c7612d3e494ffab1d3c8e78d1604daefae
|
7
|
+
data.tar.gz: fc68932462a62c9b13738f9254d46026fdfcd2ff9f62da33032d747292c7eed50ac646a0a5f0982400cff1e7c9ae7e07f6f1514c95b07c1dd9f7bf3262c2be93
|
@@ -8,15 +8,22 @@ module RailsBase::Authentication
|
|
8
8
|
delegate :user, to: :context
|
9
9
|
delegate :reason, to: :context
|
10
10
|
|
11
|
-
MAX_USE_COUNT = 1.freeze
|
12
11
|
DATA_USE = :alphanumeric
|
13
12
|
VELOCITY_MAX = 5
|
14
13
|
VELOCITY_MAX_IN_FRAME = 10.minutes
|
15
14
|
VELOCITY_FRAME = 1.hour
|
16
15
|
|
17
16
|
REASON_MAPPER = {
|
18
|
-
Constants::SVE_LOGIN_REASON => {
|
19
|
-
|
17
|
+
Constants::SVE_LOGIN_REASON => {
|
18
|
+
method: :email_verification,
|
19
|
+
url_method: :email_verification_url,
|
20
|
+
max_use: RailsBase.config.login_behavior.email_max_use_verification
|
21
|
+
},
|
22
|
+
Constants::SVE_FORGOT_REASON => {
|
23
|
+
method: :forgot_password,
|
24
|
+
url_method: :forgot_password_auth_url,
|
25
|
+
max_use: RailsBase.config.login_behavior.email_max_use_forgot
|
26
|
+
}
|
20
27
|
}
|
21
28
|
|
22
29
|
def call
|
@@ -61,7 +68,7 @@ module RailsBase::Authentication
|
|
61
68
|
def create_short_lived_data
|
62
69
|
params = {
|
63
70
|
user: user,
|
64
|
-
max_use:
|
71
|
+
max_use: REASON_MAPPER[reason][:max_use],
|
65
72
|
reason: reason,
|
66
73
|
data_use: DATA_USE,
|
67
74
|
ttl: Constants::SVE_TTL,
|
@@ -9,7 +9,17 @@ module RailsBase
|
|
9
9
|
type: :boolean,
|
10
10
|
default: true,
|
11
11
|
description: 'Enable capturing requests context when login fails. Upon login, redirect user to page they tried to go to.',
|
12
|
-
}
|
12
|
+
},
|
13
|
+
email_max_use_verification:{
|
14
|
+
type: :integer,
|
15
|
+
default: 2,
|
16
|
+
description: 'Maximum number of times User can click link for verifiaction',
|
17
|
+
},
|
18
|
+
email_max_use_forgot:{
|
19
|
+
type: :integer,
|
20
|
+
default: 2,
|
21
|
+
description: 'Maximum number of times User can click link for forgot password flow',
|
22
|
+
},
|
13
23
|
}
|
14
24
|
attr_accessor *DEFAULT_VALUES.keys
|
15
25
|
end
|
data/lib/rails_base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.56.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|