]> git.openstreetmap.org Git - rails.git/commitdiff
Show last authorization time for OAuth 2 applications
authorTom Hughes <tom@compton.nu>
Mon, 29 Jan 2024 18:50:38 +0000 (18:50 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 29 Jan 2024 22:30:12 +0000 (22:30 +0000)
Fixes #4494

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: