diff --git a/CHANGELOG b/CHANGELOG index 4d8fb3585e4c98bd7aa46b157da0701b4241ab83..3aac6f903f468292edddad902941f9260be3f77f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -55,6 +55,7 @@ v 7.8.0 (unreleased) - Allow users that signed up via OAuth to set their password in order to use Git over HTTP(S). - Show users button to share their newly created public or internal projects on twitter - Add quick help links to the GitLab pricing and feature comparison pages. + - Fix duplicate authorized applications in user profile and incorrect application client count in admin area. v 7.7.2 - Update GitLab Shell to version 2.4.2 that fixes a bug when developers can push to protected branch diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index f7584c03411e5249a2fd538b9260787dbf2c196f..a7863aba75685d95debbf6ca86db47f82dbe9c34 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -16,6 +16,7 @@ class ProfilesController < ApplicationController def applications @applications = current_user.oauth_applications @authorized_tokens = current_user.oauth_authorized_tokens + @authorized_apps = @authorized_tokens.map(&:application).uniq end def update diff --git a/app/views/admin/applications/index.html.haml b/app/views/admin/applications/index.html.haml index f2fed51eaf8e03593366e0882d69bd301fd77b8d..d550278710ebeaf8555308eb868cf9e34f83d55b 100644 --- a/app/views/admin/applications/index.html.haml +++ b/app/views/admin/applications/index.html.haml @@ -17,6 +17,6 @@ %tr{:id => "application_#{application.id}"} %td= link_to application.name, admin_application_path(application) %td= application.redirect_uri - %td= application.access_tokens.count + %td= application.access_tokens.map(&:resource_owner_id).uniq.count %td= link_to 'Edit', edit_admin_application_path(application), class: 'btn btn-link' %td= render 'delete_form', application: application diff --git a/app/views/profiles/applications.html.haml b/app/views/profiles/applications.html.haml index cb24e4a3dde0f8cd581a2ccc4d0e7477a04a3267..4b5817e10bf3d90eb49688e8af49c4e2e466cb9c 100644 --- a/app/views/profiles/applications.html.haml +++ b/app/views/profiles/applications.html.haml @@ -36,12 +36,12 @@ %th Scope %th %tbody - - @authorized_tokens.each do |token| - - application = token.application - %tr{:id => "application_#{application.id}"} - %td= application.name + - @authorized_apps.each do |app| + - token = app.authorized_tokens.order('created_at desc').first + %tr{:id => "application_#{app.id}"} + %td= app.name %td= token.created_at %td= token.scopes - %td= render 'doorkeeper/authorized_applications/delete_form', application: application + %td= render 'doorkeeper/authorized_applications/delete_form', application: app - else %p.light You dont have any authorized applications