From d9043249debc899bd066b932f928b7cd4062124e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 9 Oct 2023 20:31:35 +0200 Subject: mod_tokenauth: Periodically clear out expired tokens and grants This should ensure expired grants eventually disappear. --- plugins/mod_tokenauth.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/mod_tokenauth.lua b/plugins/mod_tokenauth.lua index 7bf19e9d..d4a30a96 100644 --- a/plugins/mod_tokenauth.lua +++ b/plugins/mod_tokenauth.lua @@ -341,3 +341,9 @@ function sasl_handler(auth_provider, purpose, extra) return token_user, true, token_info; end; end + +module:daily(function() + for username in token_store:items() do + get_user_grants(username); -- clears out expired grants + end +end) -- cgit v1.2.3