Browse Source

fix: Fixes nil error while processing wrong jwt value. Fixes #10970

Co-authored-by: David Mišurec <david.misurec@icewarp.com>
master
nosmicek 3 years ago
parent
commit
40353cf762
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      resources/prosody-plugins/token/util.lib.lua

+ 1
- 1
resources/prosody-plugins/token/util.lib.lua View File

@@ -261,7 +261,7 @@ function Util:process_and_verify_token(session, acceptedIssuers)
261 261
         pubKey = session.public_key;
262 262
     elseif self.asapKeyServer and session.auth_token ~= nil then
263 263
         local dotFirst = session.auth_token:find("%.");
264
-        if not dotFirst then return nil, "Invalid token" end
264
+        if not dotFirst then return false, "not-allowed", "Invalid token" end
265 265
         local header, err = json_safe.decode(basexx.from_url64(session.auth_token:sub(1,dotFirst-1)));
266 266
         if err then
267 267
             return false, "not-allowed", "bad token format";

Loading…
Cancel
Save