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