aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2023-03-27 20:51:07 +0100
committerMatthew Wild <mwild1@gmail.com>2023-03-27 20:51:07 +0100
commit9247a37b832d56611f72a2c5ec44f4b8e79fc61e (patch)
tree701d55997343ac717a4700fa995c98253f3ea2a4 /plugins
parentf4c1f3b35363a30350b06a30b70dfb08b31e2972 (diff)
downloadprosody-9247a37b832d56611f72a2c5ec44f4b8e79fc61e.tar.gz
prosody-9247a37b832d56611f72a2c5ec44f4b8e79fc61e.zip
mod_tokenauth: Fix traceback when checking expiry of tokens with no expiry
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_tokenauth.lua3
1 files changed, 2 insertions, 1 deletions
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