From 95baadaea2690e769c8943a7d4b9032d44a0e16f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 29 Jan 2024 18:50:38 +0000 Subject: [PATCH] Show last authorization time for OAuth 2 applications Fixes #4494 --- app/views/oauth2_authorized_applications/_application.html.erb | 3 +++ app/views/oauth2_authorized_applications/index.html.erb | 1 + config/locales/en.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/app/views/oauth2_authorized_applications/_application.html.erb b/app/views/oauth2_authorized_applications/_application.html.erb index 28d048c4a..4209b8ff9 100644 --- a/app/views/oauth2_authorized_applications/_application.html.erb +++ b/app/views/oauth2_authorized_applications/_application.html.erb @@ -9,6 +9,9 @@ <% end -%> + + <%= friendly_date_ago(application.authorized_tokens.where(:resource_owner_id => current_user).maximum(:created_at)) %> + <%= link_to t(".revoke"), oauth_authorized_application_path(application), { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_revoke") } } %> diff --git a/app/views/oauth2_authorized_applications/index.html.erb b/app/views/oauth2_authorized_applications/index.html.erb index 2d3ad00bd..59d692393 100644 --- a/app/views/oauth2_authorized_applications/index.html.erb +++ b/app/views/oauth2_authorized_applications/index.html.erb @@ -10,6 +10,7 @@ <%= t ".application" %> <%= t ".permissions" %> + <%= t ".last_authorized" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index c7325e64f..0d2e9eebc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: -- 2.39.5