2018-09-23 19:44:14 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-12-19 14:15:29 +00:00
|
|
|
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
|
2015-05-01 08:39:11 +00:00
|
|
|
include PageLayoutHelper
|
|
|
|
|
|
|
|
layout 'profile'
|
2014-12-19 14:15:29 +00:00
|
|
|
|
2020-04-30 21:09:47 +00:00
|
|
|
def index
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { render "errors/not_found", layout: "errors", status: :not_found }
|
|
|
|
format.json { render json: "", status: :not_found }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-12-19 14:15:29 +00:00
|
|
|
def destroy
|
2015-07-02 09:53:31 +00:00
|
|
|
if params[:token_id].present?
|
|
|
|
current_resource_owner.oauth_authorized_tokens.find(params[:token_id]).revoke
|
|
|
|
else
|
2020-08-05 21:09:40 +00:00
|
|
|
Doorkeeper::Application.revoke_tokens_and_grants_for(params[:id], current_resource_owner)
|
2015-07-02 09:53:31 +00:00
|
|
|
end
|
|
|
|
|
2017-06-06 22:45:16 +00:00
|
|
|
redirect_to applications_profile_url,
|
2019-11-17 12:06:19 +00:00
|
|
|
status: :found,
|
2017-06-06 22:45:16 +00:00
|
|
|
notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
|
2014-12-19 14:15:29 +00:00
|
|
|
end
|
2014-12-25 14:46:28 +00:00
|
|
|
end
|