Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

bump rotp

ulfertsdb1075722e86
diff --git a/Gemfile.lock b/Gemfile.lock
index 924675e9133..e606fba301b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -193,7 +193,7 @@ PATH
openproject-two_factor_authentication (1.0.0)
aws-sdk-sns (~> 1.22.0)
messagebird-rest (~> 1.4.2)
- rotp (~> 3.3)
+ rotp (~> 5.1)
PATH
remote: modules/webhooks
@@ -793,7 +793,8 @@ GEM
rinku (2.0.6)
roar (1.1.0)
representable (~> 3.0.0)
- rotp (3.3.1)
+ rotp (5.1.0)
+ addressable (~> 2.5)
rouge (3.1.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
diff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb
index c0a5d082711..047545492d2 100644
--- a/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb
+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb
@@ -24,7 +24,7 @@ module TwoFactorAuthentication
##
# verify the given OTP input
def verify_token(token)
- result = totp.verify_with_drift_and_prior(token.to_s, allowed_drift, last_used_at)
+ result = totp.verify(token.to_s, drift_behind: allowed_drift, drift_ahead: allowed_drift, after: last_used_at)
if result.nil?
false
diff --git a/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec b/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec
index e03f2458ccc..b703d646b39 100644
--- a/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec
+++ b/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*", "CHANGELOG.md", "README.rdoc"]
s.test_files = Dir["spec/**/*"]
- s.add_dependency 'rotp', '~> 3.3'
+ s.add_dependency 'rotp', '~> 5.1'
s.add_dependency 'messagebird-rest', '~> 1.4.2'
s.add_dependency 'aws-sdk-sns', '~> 1.22.0'