From 12fc0febf172dd25d403af6365f3e5042b06d6dd Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 6 Oct 2022 16:00:39 +0100 Subject: mod_tokenauth: Remove expired tokens from storage --- plugins/mod_tokenauth.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_tokenauth.lua b/plugins/mod_tokenauth.lua index 450e2f0a..22d2199a 100644 --- a/plugins/mod_tokenauth.lua +++ b/plugins/mod_tokenauth.lua @@ -65,12 +65,14 @@ local function _get_parsed_token_info(token_id, token_user, token_host) end if token_info.expires and token_info.expires < os.time() then + token_store:set(token_user, token_id, nil); return nil, "not-authorized"; end local account_info = usermanager.get_account_info(token_user, module.host); local password_updated_at = account_info and account_info.password_updated; if password_updated_at and password_updated_at > token_info.created then + token_store:set(token_user, token_id, nil); return nil, "not-authorized"; end -- cgit v1.2.3