]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #4502 from tomhughes/oauth2-authorization-time
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 31 Jan 2024 14:26:52 +0000 (14:26 +0000)
committerGitHub <noreply@github.com>
Wed, 31 Jan 2024 14:26:52 +0000 (14:26 +0000)
Show last authorization time for OAuth 2 applications

app/views/oauth2_authorized_applications/_application.html.erb
app/views/oauth2_authorized_applications/index.html.erb
config/locales/en.yml

index 28d048c4a098a727d7f289aec84c61ebce69cd6e..4209b8ff919acb36cc5e1bddd98bb3d707fc92ee 100644 (file)
@@ -9,6 +9,9 @@
       <% end -%>
     </ul>
   </td>
+  <td class="align-middle">
+    <%= friendly_date_ago(application.authorized_tokens.where(:resource_owner_id => current_user).maximum(:created_at)) %>
+  </td>
   <td class="align-middle text-end">
     <%= link_to t(".revoke"), oauth_authorized_application_path(application), { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_revoke") } } %>
   </td>
index 2d3ad00bdea337b269b3609298ebb0c7d92065ab..59d692393257b4617f7fbcc2f40b500fe743edd5 100644 (file)
@@ -10,6 +10,7 @@
       <tr>
         <th><%= t ".application" %></th>
         <th><%= t ".permissions" %></th>
+        <th><%= t ".last_authorized" %></th>
         <th></th>
       </tr>
     </thead>
index c7325e64f117652d13e92d51a37c51aff4fb940d..0d2e9eebc7b0ecff77c6684627c807bb368dd878 100644 (file)
@@ -2684,6 +2684,7 @@ en:
       title: "My Authorized Applications"
       application: "Application"
       permissions: "Permissions"
+      last_authorized: "Last Authorized"
       no_applications_html: "You have not yet authorized any %{oauth2} applications."
       oauth_2: "OAuth 2"
     application: