diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-07-02 12:53:31 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-07-02 12:53:31 +0300 |
commit | cd5e79e98b7f08a6fa6999d25e158073fee03048 (patch) | |
tree | 6b044412b1285a8bf2e98c52e13c3607f3ad27e8 /app/controllers/oauth/authorized_applications_controller.rb | |
parent | 2cbf45282168938696867072cb3e35131bc44a93 (diff) |
Correctly show anonymous authorized applications under Profile > Applications.
Diffstat (limited to 'app/controllers/oauth/authorized_applications_controller.rb')
-rw-r--r-- | app/controllers/oauth/authorized_applications_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/oauth/authorized_applications_controller.rb b/app/controllers/oauth/authorized_applications_controller.rb index 3ab6def511c..4193ac11399 100644 --- a/app/controllers/oauth/authorized_applications_controller.rb +++ b/app/controllers/oauth/authorized_applications_controller.rb @@ -4,7 +4,12 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio layout 'profile' def destroy - Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner) + 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 + redirect_to applications_profile_url, notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy]) end end |