# HG changeset patch # User Kim Alvefur # Date 1689339716 -7200 # Node ID eae5599bc0b432ed649d1c729e7e9f1deefafd84 # Parent e9af6abf2b1eebda9249412d15b30b174107f665 mod_client_management: Add way to revoke (one) client by software This is a bit hacky but it works. diff -r e9af6abf2b1e -r eae5599bc0b4 mod_client_management/mod_client_management.lua --- a/mod_client_management/mod_client_management.lua Fri Jul 14 13:25:30 2023 +0200 +++ b/mod_client_management/mod_client_management.lua Fri Jul 14 15:01:56 2023 +0200 @@ -311,6 +311,13 @@ local ok = tokenauth.revoke_grant(username, c_id); if not ok then return nil, "internal-server-error"; end return true; + elseif c_type == "software" then + local active_clients = get_active_clients(username); + for _, client in ipairs(active_clients) do + if client.user_agent and client.user_agent.software == c_id then + return revoke_client_access(username, client.id); + end + end end end