def index
      @sessions = Session.where(user: @user)
      expired = []
      active = []
      @sessions.each do |session|
        if session.expired?
          expired << session.uuid
        else
          active << session
        end
      end
      SessionsCleanupJob.perform_later(*expired)
      render json: active, except: [:secret]
    end
def index
      @sessions = Session.where(user: @user)
      expired = []
      active = []
      @sessions.each do |session|
        if session.expired?
          expired << session.uuid
        else
          active << session
        end
      end
      SessionsCleanupJob.perform_later(*expired)
      render json: active, except: [:secret]
    end
Lists all sessions that belong to the specified or authenticated user.