mod_client_management/mod_client_management.lua
changeset 5698 8afa0fb8a73e
parent 5687 c69320fc438b
child 5757 3730992d0c7c
--- a/mod_client_management/mod_client_management.lua	Tue Nov 07 11:28:46 2023 +0000
+++ b/mod_client_management/mod_client_management.lua	Fri Nov 10 00:26:17 2023 +0100
@@ -471,10 +471,24 @@
 			};
 			{
 				title = "Expires";
-				key = "expires";
+				key = "active";
 				width = date_or_time_width;
 				align = "right";
-				mapper = date_or_time;
+				mapper = function(active, client)
+					local grant = active and active.grant;
+					local expires = client and client.expires;
+					local tokens = grant and grant.tokens;
+					if expires or not tokens then
+						return date_or_time(expires);
+					end
+
+					for _, token in pairs(tokens) do
+						if token.expires and (not expires or token.expires > expires) then
+							expires = token.expires;
+						end
+					end
+					return date_or_time(expires);
+				end;
 			};
 			{
 				title = "Authentication";