2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
class Profiles::ActiveSessionsController < Profiles::ApplicationController
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :users
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
def index
|
2019-03-13 22:55:13 +05:30
|
|
|
@sessions = ActiveSession.list(current_user).reject(&:is_impersonated)
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
def destroy
|
2020-10-04 03:57:07 +05:30
|
|
|
# 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-03 11:15:55 +05:30
|
|
|
current_user.forget_me!
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { redirect_to profile_active_sessions_url, status: :found }
|
|
|
|
format.js { head :ok }
|
|
|
|
end
|
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|