comparison mod_client_management/mod_client_management.lua @ 5307:2bb27dfd10d5

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).
author Matthew Wild <mwild1@gmail.com>
date Thu, 06 Apr 2023 15:20:25 +0100
parents 210aeb5afe42
children f370ccb15f05
comparison
equal deleted inserted replaced
5306:210aeb5afe42 5307:2bb27dfd10d5
241 241
242 -- Next, account for any grants that have been issued, but never actually logged in 242 -- Next, account for any grants that have been issued, but never actually logged in
243 for grant_id, grant in pairs(tokenauth.get_user_grants(username) or {}) do 243 for grant_id, grant in pairs(tokenauth.get_user_grants(username) or {}) do
244 if not used_grants[grant_id] then -- exclude grants already accounted for 244 if not used_grants[grant_id] then -- exclude grants already accounted for
245 table.insert(active_clients, { 245 table.insert(active_clients, {
246 id = "grant/"..grant.id; 246 id = "grant/"..grant_id;
247 type = "access"; 247 type = "access";
248 first_seen = grant.created; 248 first_seen = grant.created;
249 last_seen = grant.accessed; 249 last_seen = grant.accessed;
250 active = { 250 active = {
251 grant = grant; 251 grant = grant;