Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/user_settings/active_sessions_controller.rb')
-rw-r--r--app/controllers/user_settings/active_sessions_controller.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/user_settings/active_sessions_controller.rb b/app/controllers/user_settings/active_sessions_controller.rb
new file mode 100644
index 00000000000..da5664a8c1b
--- /dev/null
+++ b/app/controllers/user_settings/active_sessions_controller.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class UserSettings::ActiveSessionsController < Profiles::ApplicationController
+ feature_category :system_access
+
+ def index
+ @sessions = ActiveSession.list(current_user).reject(&:is_impersonated)
+ end
+
+ def destroy
+ # params[:id] can be an Rack::Session::SessionId#private_id
+ ActiveSession.destroy_session(current_user, params[:id])
+ current_user.forget_me!
+
+ respond_to do |format|
+ format.html { redirect_to user_settings_active_sessions_url, status: :found }
+ format.js { head :ok }
+ end
+ end
+end