# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1679946667 -3600
# Node ID c87ac7d1967f2668df64d0cfd3dc1752bb3e1e6d
# Parent  601d9a375b864c59432d07429f657816db9826eb
mod_tokenauth: Fix traceback when checking expiry of tokens with no expiry

diff -r 601d9a375b86 -r c87ac7d1967f 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