aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_tokenauth.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-10-09 20:26:30 +0200
committerKim Alvefur <zash@zash.se>2023-10-09 20:26:30 +0200
commit4df58bc22f231c504b55ae5e4d8f1942734a14f7 (patch)
tree463d4aa7468eb8ad9b8052673aaa233dd27cef38 /plugins/mod_tokenauth.lua
parent33657b4001c5ac339157a749524076a7cdc6fade (diff)
downloadprosody-4df58bc22f231c504b55ae5e4d8f1942734a14f7.tar.gz
prosody-4df58bc22f231c504b55ae5e4d8f1942734a14f7.zip
mod_tokenauth: Delete grants in the wrong formats on retrieval
Diffstat (limited to 'plugins/mod_tokenauth.lua')
-rw-r--r--plugins/mod_tokenauth.lua5
1 files changed, 5 insertions, 0 deletions
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