From 4df58bc22f231c504b55ae5e4d8f1942734a14f7 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 9 Oct 2023 20:26:30 +0200 Subject: mod_tokenauth: Delete grants in the wrong formats on retrieval --- plugins/mod_tokenauth.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mod_tokenauth.lua') diff --git a/plugins/mod_tokenauth.lua b/plugins/mod_tokenauth.lua index cf34b48c..6c94e34f 100644 --- a/plugins/mod_tokenauth.lua +++ b/plugins/mod_tokenauth.lua @@ -159,6 +159,11 @@ local function _get_validated_grant_info(username, grant) return nil, "expired"; end + if not grant.tokens then + module:log("debug", "Token grant without tokens, cleaning up"); + token_store:set_key(username, grant.id, nil); + return nil, "invalid"; + end return grant; end -- cgit v1.2.3