//= require jquery

$(function() {
  $('.login-trello').click(function() {
    Trello.authorize({
      type: "redirect",
      name: "Reportrello",
      scope: {
        read: true,
        write: true
      }
    });
  });
})
@@ -76,9 +76,14 @@
     
-T
+Report
 rell
@@ -98,40 +98,141 @@
 ize(
-%7B%0A      type: %22redirect%22
+);%0A  %7D);%0A%0A  Reportrello = %7B%0A    authorize: function() %7B%0A      var self = this%0A%0A      Trello.authorize(%7B%0A        type: 'popup'
 ,%0A      
 name
@@ -231,15 +231,17 @@
     
+  
 name: 
-%22
+'
 Repo
@@ -251,11 +251,46 @@
 ello
-%22,%0A
+',%0A        fragment: 'postmessage',%0A  
     
@@ -308,16 +308,18 @@
         
+  
 read: tr
@@ -322,16 +322,18 @@
 : true,%0A
+  
         
@@ -354,22 +354,726 @@
     
-%7D%0A    %7D);%0A  %7D);
+  %7D,%0A        expiration: 'never',%0A        success: function() %7B%0A          self.getMe();%0A        %7D,%0A        error: function() %7B%0A          alert(%22Failed authentication%22);%0A        %7D%0A      %7D);%0A    %7D,%0A%0A    getMe: function() %7B%0A      var token = localStorage.getItem('trello_token');%0A%0A      Trello.rest(%0A        'GET',%0A        'members/me',%0A        %7B%0A          fields: 'username,fullName,avatar',%0A          token: token%0A        %7D,%0A        function (object) %7B%0A          location.href = '/authentication/?user%5Btoken%5D=' + token + '&user%5Busername%5D=' + object.username + '&user%5Bfullname%5D=' + object.fullName%0A        %7D,%0A        function (a) %7B alert(%22Failed authentication%22); %7D%0A      );%0A    %7D,%0A%0A    newReport: function() %7B%0A%0A    %7D%0A  %7D
 %0A%7D)

Add JS to authentication and get user information by token