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

Fix spec

Dombi Attila26aa772f4576
diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb
index 56d03f16700..d224bbbde88 100644
--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb
+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb
@@ -99,6 +99,8 @@ module ::TwoFactorAuthentication
# Get the used device for verification
def otp_service_for_verification(user)
otp_service(user, use_device: remembered_device(user))
+ rescue ActiveRecord::RecordNotFound
+ render_404
false
end
@@ -118,6 +120,8 @@ module ::TwoFactorAuthentication
end
otp_service(@authenticated_user, use_channel: channel, use_device: device)
+ rescue ActiveRecord::RecordNotFound
+ render_404
false
end