From 9e02d322d8f8bfe4b7cdae3c2da33827d7defa60 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 1 Mar 2023 18:43:54 +0000 Subject: mod_tokenauth: Gracefully handle missing tokens --- plugins/mod_tokenauth.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mod_tokenauth.lua b/plugins/mod_tokenauth.lua index 8b24bc17..1eb5c66b 100644 --- a/plugins/mod_tokenauth.lua +++ b/plugins/mod_tokenauth.lua @@ -49,6 +49,7 @@ function create_jid_token(actor_jid, token_jid, token_role, token_ttl, token_dat end local function parse_token(encoded_token) + if not encoded_token then return nil; end local token = base64.decode(encoded_token); if not token then return nil; end local token_jid, token_id = token:match("^1;([^;]+);(.+)$"); -- cgit v1.2.3