浏览代码

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

Co-authored-by: David Mišurec <david.misurec@icewarp.com>
master
nosmicek 3 年前
父节点
当前提交
40353cf762
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      resources/prosody-plugins/token/util.lib.lua

+ 1
- 1
resources/prosody-plugins/token/util.lib.lua 查看文件

@@ -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";

正在加载...
取消
保存