rodauth 2.49.0 → 2.50.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 +4 -4
- data/lib/rodauth/features/audit_logging.rb +4 -2
- data/lib/rodauth/features/otp.rb +5 -4
- data/lib/rodauth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c7c3fd220443be9dd5e5b2d565d2bb00cc295ca3a715b33c785265e1f6d68965
|
|
4
|
+
data.tar.gz: e73cdd307e16ab113fdd6c7082a80007748d0ebdbfda7bbcbafae428b69e1dc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba857c68a2b1c54de8195798340cbe4a6f992b9f357c68a977aa78e1469c5d8b2b8eee3cdd3905109cb1c5ff127cb391b016f48cd55c56d32a44e8497f9f6abe
|
|
7
|
+
data.tar.gz: 75dc0b8cd4ca3c6142c74a30c190eb5ed6ad54580d1a89a4357abc659779cb80d9450276ffb4435ca0eeed7747187cbbe595d65d73292a0975fee24bc581d7b7
|
|
@@ -31,8 +31,10 @@ module Rodauth
|
|
|
31
31
|
def hook_action(hook_type, action)
|
|
32
32
|
super
|
|
33
33
|
|
|
34
|
-
#
|
|
35
|
-
|
|
34
|
+
# Audit after successful actions. Logout is audited on before_logout
|
|
35
|
+
# because logout/clear_session runs before after_logout and does not
|
|
36
|
+
# clear @account, which would otherwise duplicate the logout audit.
|
|
37
|
+
if hook_type == (action == :logout ? :before : :after) && (id = account_id_or_session_value)
|
|
36
38
|
add_audit_log(id, action)
|
|
37
39
|
end
|
|
38
40
|
end
|
data/lib/rodauth/features/otp.rb
CHANGED
|
@@ -100,7 +100,7 @@ module Rodauth
|
|
|
100
100
|
:otp_valid_code_for_old_secret
|
|
101
101
|
)
|
|
102
102
|
|
|
103
|
-
uses_instance_variables(:@otp, :@otp_key, :@otp_user_key, :@otp_tmp_key)
|
|
103
|
+
uses_instance_variables(:@otp, :@otp_key, :@otp_user_key, :@otp_tmp_key, :@otp_verify_time)
|
|
104
104
|
|
|
105
105
|
internal_request_method :otp_setup_params
|
|
106
106
|
internal_request_method :otp_setup
|
|
@@ -275,7 +275,7 @@ module Rodauth
|
|
|
275
275
|
otp.verify_with_drift(ot_pass, drift)
|
|
276
276
|
# simplecov:enable
|
|
277
277
|
else
|
|
278
|
-
otp.verify(ot_pass, :drift_behind=>drift, :drift_ahead=>drift, :after=>otp_last_use)
|
|
278
|
+
@otp_verify_time = otp.verify(ot_pass, :drift_behind=>drift, :drift_ahead=>drift, :after=>otp_last_use)
|
|
279
279
|
end
|
|
280
280
|
# simplecov:disable
|
|
281
281
|
elsif otp.respond_to?(:verify_with_drift)
|
|
@@ -297,9 +297,10 @@ module Rodauth
|
|
|
297
297
|
end
|
|
298
298
|
|
|
299
299
|
def otp_update_last_use
|
|
300
|
+
verify_time = @otp_verify_time.is_a?(Integer) ? Time.at(@otp_verify_time) : Sequel::CURRENT_TIMESTAMP # simplecov:disable
|
|
300
301
|
otp_key_ds.
|
|
301
|
-
where(Sequel.date_add(otp_keys_last_use_column, :seconds=>_otp_interval) <
|
|
302
|
-
update(otp_keys_last_use_column=>
|
|
302
|
+
where(Sequel.date_add(otp_keys_last_use_column, :seconds=>_otp_interval) < verify_time).
|
|
303
|
+
update(otp_keys_last_use_column=>verify_time) == 1
|
|
303
304
|
end
|
|
304
305
|
|
|
305
306
|
def otp_last_use
|
data/lib/rodauth/version.rb
CHANGED