From 9247a37b832d56611f72a2c5ec44f4b8e79fc61e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 27 Mar 2023 20:51:07 +0100 Subject: mod_tokenauth: Fix traceback when checking expiry of tokens with no expiry --- plugins/mod_tokenauth.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_tokenauth.lua b/plugins/mod_tokenauth.lua index 74d68e75..04cc37a1 100644 --- a/plugins/mod_tokenauth.lua +++ b/plugins/mod_tokenauth.lua @@ -123,7 +123,8 @@ local function clear_expired_grant_tokens(grant, now) local updated; now = now or os.time(); for secret, token_info in pairs(grant.tokens) do - if token_info.expires < now then + local expires = token_info.expires; + if expires and expires < now then grant.tokens[secret] = nil; updated = true; end -- cgit v1.2.3