mod_tokenauth: Fix traceback when checking expiry of tokens with no expiry
authorMatthew Wild <mwild1@gmail.com>
Mon, 27 Mar 2023 20:51:07 +0100
changeset 13003 c87ac7d1967f
parent 13002 601d9a375b86
child 13004 c7253174503e
mod_tokenauth: Fix traceback when checking expiry of tokens with no expiry
plugins/mod_tokenauth.lua
--- a/plugins/mod_tokenauth.lua	Mon Mar 27 18:35:57 2023 +0100
+++ b/plugins/mod_tokenauth.lua	Mon Mar 27 20:51:07 2023 +0100
@@ -123,7 +123,8 @@
 	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