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

Log message when terminating sessions

Oliver Güntherd05c3ce87362
diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb
index 418221b64c3..0e8c5b53ae5 100644
--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb
+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb
@@ -132,6 +132,7 @@ module ::TwoFactorAuthentication
def index_path
raise NotImplementedError
end
+
helper_method :index_path
def registration_failure_path
@@ -152,8 +153,10 @@ module ::TwoFactorAuthentication
def logout_other_sessions
if current_user == target_user
+ Rails.logger.info { "First 2FA device registered for #{target_user}, terminating other logged in sessions." }
::Sessions::DropOtherSessionsService.call(target_user, session)
else
+ Rails.logger.info { "First 2FA device registered for #{target_user}, terminating logged in sessions." }
::Sessions::DropAllSessionsService.call(target_user)
end
end