two_factor_cookies 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/app/controllers/two_factor_cookies/toggle_two_factor_controller.rb +2 -1
- data/app/controllers/two_factor_cookies/two_factor_authentication_controller.rb +2 -2
- data/lib/two_factor_cookies/configuration.rb +2 -2
- data/lib/two_factor_cookies/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efbaa798edb3ec55cf5a415366bd8aecada341d07ca81735a4653f127a4d0bfe
|
4
|
+
data.tar.gz: 3e11e5160ba5786799ad18b9cc9ceccb9fbcb9b7a2f94ca4c5151deb803ae2f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c13f49d933a8ee9695cabb0c3fbd64892d40b54cf35e75806bd451a802cdb547eb6bd28cd1ef53d097394f5d49bb92a0a2f2dbd8985204909c71d307d6320d4
|
7
|
+
data.tar.gz: ff45c450ea63e31fdf512626b6ad5a31bf15c9dde7057bdab993cd6df445734146095d3da87f69132f6e424b4c6c9909aa22e18a3609d6bb4615ce9901eaf054
|
data/README.md
CHANGED
@@ -29,10 +29,11 @@ TwoFactorCookies.configure do |config|
|
|
29
29
|
config.otp_generation_secret_key = MUST BE FILLED
|
30
30
|
|
31
31
|
# Cookie expiry
|
32
|
+
# The values need to be an amount of seconds, for instance `30.minutes`. The gem adds this amount to the Time.zone.now and uses this to set the cookie's expiry
|
32
33
|
# When a user will need to perform 2fa again
|
33
|
-
# config.two_factor_authentication_expiry = 30.days
|
34
|
+
# config.two_factor_authentication_expiry = 30.days
|
34
35
|
# How much time a user has to type in the otp sent to his phone
|
35
|
-
# config.otp_expiry = 30.minutes
|
36
|
+
# config.otp_expiry = 30.minutes
|
36
37
|
|
37
38
|
# Twilio API credentials
|
38
39
|
config.twilio_account_sid = MUST BE FILLED
|
@@ -15,7 +15,8 @@ TwoFactorCookies.const_set('ToggleTwoFactorController',
|
|
15
15
|
|
16
16
|
redirect_to eval(TwoFactorCookies.configuration.engine_name).public_send(
|
17
17
|
TwoFactorCookies.configuration.confirm_phone_number_success_route,
|
18
|
-
current_user.to_param
|
18
|
+
current_user.to_param
|
19
|
+
)
|
19
20
|
end
|
20
21
|
|
21
22
|
def toggle_two_factor
|
@@ -59,7 +59,7 @@ TwoFactorCookies.const_set('TwoFactorAuthenticationController',
|
|
59
59
|
value: JSON.generate(
|
60
60
|
standard_values.merge(additional_authentication_values)
|
61
61
|
),
|
62
|
-
expires: TwoFactorCookies.configuration.two_factor_authentication_expiry
|
62
|
+
expires: Time.zone.now + TwoFactorCookies.configuration.two_factor_authentication_expiry
|
63
63
|
}
|
64
64
|
end
|
65
65
|
|
@@ -67,7 +67,7 @@ TwoFactorCookies.const_set('TwoFactorAuthenticationController',
|
|
67
67
|
cookies.delete(:mfa)
|
68
68
|
cookies.encrypted[:mfa] = {
|
69
69
|
value: JSON.generate(seed: seed, user_name: current_user.public_send(TwoFactorCookies.configuration.username_field_name)),
|
70
|
-
expires: TwoFactorCookies.configuration.otp_expiry
|
70
|
+
expires: Time.zone.now + TwoFactorCookies.configuration.otp_expiry
|
71
71
|
}
|
72
72
|
end
|
73
73
|
|
@@ -8,8 +8,8 @@ module TwoFactorCookies
|
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@otp_generation_secret_key = nil
|
11
|
-
@two_factor_authentication_expiry = 30.days
|
12
|
-
@otp_expiry = 30.minutes
|
11
|
+
@two_factor_authentication_expiry = 30.days
|
12
|
+
@otp_expiry = 30.minutes
|
13
13
|
|
14
14
|
@twilio_account_sid = nil
|
15
15
|
@twilio_phone_number = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: two_factor_cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolai Bach Woller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -158,7 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 2.7.6
|
162
163
|
signing_key:
|
163
164
|
specification_version: 4
|
164
165
|
summary: Simple two factor logon - with Twilio SMS for code delivery
|