2018-09-23 15:44:14 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-12-19 09:15:29 -05:00
|
|
|
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
|
2015-05-01 04:39:11 -04:00
|
|
|
include PageLayoutHelper
|
|
|
|
|
|
|
|
layout 'profile'
|
2014-12-19 09:15:29 -05:00
|
|
|
|
|
|
|
def destroy
|
2015-07-02 05:53:31 -04:00
|
|
|
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
|
|
|
|
|
2017-06-06 18:45:16 -04:00
|
|
|
redirect_to applications_profile_url,
|
|
|
|
status: 302,
|
|
|
|
notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
|
2014-12-19 09:15:29 -05:00
|
|
|
end
|
2014-12-25 09:46:28 -05:00
|
|
|
end
|