We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ac1fab commit 43684f2Copy full SHA for 43684f2
lib/active_model/one_time_password.rb
@@ -49,7 +49,7 @@ def authenticate_otp(code, options = {})
49
result = hotp.verify(code, otp_counter)
50
if result && options[:auto_increment]
51
self.otp_counter += 1
52
- save if respond_to?(:new_record?) && !new_record?
+ save if respond_to?(:changed?) && !new_record?
53
end
54
result
55
else
@@ -66,7 +66,7 @@ def otp_code(options = {})
66
if otp_counter_based
67
if options[:auto_increment]
68
69
70
71
ROTP::HOTP.new(otp_column, digits: otp_digits).at(self.otp_counter)
72
0 commit comments