mod_client_management: Use grant id from key
authorMatthew Wild <mwild1@gmail.com>
Thu, 06 Apr 2023 15:20:25 +0100
changeset 5311 2bb27dfd10d5
parent 5310 210aeb5afe42
child 5312 f370ccb15f05
mod_client_management: Use grant id from key This is a minor tweak - it's faster and preserves compatibility with older data formats (that we don't necessarily want to be compatible with, but some of us have messy data stores and it pays to be a little more robust).
mod_client_management/mod_client_management.lua
--- a/mod_client_management/mod_client_management.lua	Wed Apr 05 19:45:13 2023 +0100
+++ b/mod_client_management/mod_client_management.lua	Thu Apr 06 15:20:25 2023 +0100
@@ -243,7 +243,7 @@
 	for grant_id, grant in pairs(tokenauth.get_user_grants(username) or {}) do
 		if not used_grants[grant_id] then -- exclude grants already accounted for
 			table.insert(active_clients, {
-				id = "grant/"..grant.id;
+				id = "grant/"..grant_id;
 				type = "access";
 				first_seen = grant.created;
 				last_seen = grant.accessed;