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

Co-authored-by: David Mišurec <david.misurec@icewarp.com>
This commit is contained in:
nosmicek 2022-02-17 19:05:39 +01:00 committed by GitHub
parent a1d0111c1b
commit 40353cf762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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