debian-mirror-gitlab/app/controllers/oauth/authorized_applications_controller.rb

20 lines
594 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2015-04-26 12:48:37 +05:30
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
2015-09-11 14:41:01 +05:30
include PageLayoutHelper
layout 'profile'
2015-04-26 12:48:37 +05:30
def destroy
2015-09-11 14:41:01 +05:30
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-09-10 17:25:29 +05:30
redirect_to applications_profile_url,
2019-12-26 22:10:19 +05:30
status: :found,
2017-09-10 17:25:29 +05:30
notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
2015-04-26 12:48:37 +05:30
end
end