From: Tom Hughes Date: Mon, 29 Jan 2024 18:50:38 +0000 (+0000) Subject: Show last authorization time for OAuth 2 applications X-Git-Tag: live~327^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/95baadaea2690e769c8943a7d4b9032d44a0e16f?ds=sidebyside Show last authorization time for OAuth 2 applications Fixes #4494 --- 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: