Commit 49d50993 authored by Vinnie Okada's avatar Vinnie Okada

Avoid duplicate application rows

Iterate over authorized applications instead of tokens to avoid multiple
rows for the same authorized app.
parent ee804e2d
......@@ -16,6 +16,9 @@ class ProfilesController < ApplicationController
def applications
@applications = current_user.oauth_applications
@authorized_tokens = current_user.oauth_authorized_tokens
@authorized_apps = @authorized_tokens.map do |token|
token.application
end.uniq
end
def update
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment