2018-09-23 19:44:14 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-02 08:08:16 +00:00
|
|
|
class Profiles::ActiveSessionsController < Profiles::ApplicationController
|
2020-10-08 18:08:32 +00:00
|
|
|
feature_category :users
|
|
|
|
|
2018-05-02 08:08:16 +00:00
|
|
|
def index
|
2019-02-23 18:18:44 +00:00
|
|
|
@sessions = ActiveSession.list(current_user).reject(&:is_impersonated)
|
2018-05-02 08:08:16 +00:00
|
|
|
end
|
2020-01-03 09:07:33 +00:00
|
|
|
|
|
|
|
def destroy
|
2020-10-01 18:10:20 +00:00
|
|
|
# params[:id] can be either an Rack::Session::SessionId#private_id
|
|
|
|
# or an encrypted Rack::Session::SessionId#public_id
|
|
|
|
ActiveSession.destroy_with_deprecated_encryption(current_user, params[:id])
|
2020-09-02 15:10:54 +00:00
|
|
|
current_user.forget_me!
|
2020-01-03 09:07:33 +00:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { redirect_to profile_active_sessions_url, status: :found }
|
|
|
|
format.js { head :ok }
|
|
|
|
end
|
|
|
|
end
|
2018-05-02 08:08:16 +00:00
|
|
|
end
|