BigW Consortium Gitlab

authorized_applications_controller.rb 515 Bytes
Newer Older
Valery Sizov committed
1
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
2 3 4
  include PageLayoutHelper

  layout 'profile'
Valery Sizov committed
5 6

  def destroy
7 8 9 10 11 12
    if params[:token_id].present?
      current_resource_owner.oauth_authorized_tokens.find(params[:token_id]).revoke
    else
      Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner)
    end

13
    redirect_to applications_profile_url, notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
Valery Sizov committed
14
  end
Dmitriy Zaporozhets committed
15
end