mod_tokenauth: Ignore invalid grants in storage that have no id
authorMatthew Wild <mwild1@gmail.com>
Wed, 29 Nov 2023 17:51:34 +0000
changeset 13360 bbbda8819331
parent 13359 a6c8a50cdfb5
child 13361 f424c9f1460b
mod_tokenauth: Ignore invalid grants in storage that have no id
plugins/mod_tokenauth.lua
--- a/plugins/mod_tokenauth.lua	Wed Nov 29 17:50:33 2023 +0000
+++ b/plugins/mod_tokenauth.lua	Wed Nov 29 17:51:34 2023 +0000
@@ -145,7 +145,7 @@
 	if type(grant) == "string" then
 		grant = token_store:get_key(username, grant);
 	end
-	if not grant or not grant.created then return nil; end
+	if not grant or not grant.created or not grant.id then return nil; end
 
 	-- Invalidate grants from before last password change
 	local account_info = usermanager.get_account_info(username, module.host);