active_sessions_controller.rb 420 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4
class Profiles::ActiveSessionsController < Profiles::ApplicationController
  def index
5
    @sessions = ActiveSession.list(current_user).reject(&:is_impersonated)
6 7 8 9 10 11
  end

  def destroy
    ActiveSession.destroy(current_user, params[:id])

    respond_to do |format|
Lin Jen-Shin's avatar
Lin Jen-Shin committed
12
      format.html { redirect_to profile_active_sessions_url, status: :found }
13 14 15 16
      format.js { head :ok }
    end
  end
end