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
|
2022-06-02 21:09:25 +00:00
|
|
|
feature_category :authentication_and_authorization
|
2020-10-08 18:08:32 +00:00
|
|
|
|
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
|
2021-03-05 00:09:24 +00:00
|
|
|
# params[:id] can be an Rack::Session::SessionId#private_id
|
|
|
|
ActiveSession.destroy_session(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
|