Sha256: 2f44134a50f5d20bf6abfa11e661254687abac1a1825c809eb78ff11fc17f4aa

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  class AuthorizedApplicationsController < Doorkeeper::ApplicationController
    before_action :authenticate_resource_owner!

    def index
      @applications = Doorkeeper.config.application_model.authorized_for(current_resource_owner)

      respond_to do |format|
        format.html
        format.json { render json: @applications, current_resource_owner: current_resource_owner }
      end
    end

    def destroy
      Doorkeeper.config.application_model.revoke_tokens_and_grants_for(
        params[:id],
        current_resource_owner,
      )

      respond_to do |format|
        format.html do
          redirect_to oauth_authorized_applications_url, notice: I18n.t(
            :notice, scope: %i[doorkeeper flash authorized_applications destroy],
          )
        end

        format.json { render :no_content }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
doorkeeper-5.5.0 app/controllers/doorkeeper/authorized_applications_controller.rb
doorkeeper-5.5.0.rc2 app/controllers/doorkeeper/authorized_applications_controller.rb
doorkeeper-5.5.0.rc1 app/controllers/doorkeeper/authorized_applications_controller.rb
doorkeeper-5.4.0 app/controllers/doorkeeper/authorized_applications_controller.rb
doorkeeper-5.4.0.rc2 app/controllers/doorkeeper/authorized_applications_controller.rb